Reposition r8253's change to avoid redundant index lookups.
[sgt/agedu] / agedu.c
diff --git a/agedu.c b/agedu.c
index 07e9415..68a9799 100644 (file)
--- a/agedu.c
+++ b/agedu.c
@@ -173,6 +173,9 @@ static void text_query(const void *mappedfile, const char *querydir,
     xi1 = trie_before(mappedfile, querydir);
     xi2 = trie_before(mappedfile, pathbuf);
 
+    if (xi2 - xi1 == 1)
+       return;                        /* file, or empty dir => no display */
+
     /*
      * Now do the lookups in the age index.
      */