summaryrefslogtreecommitdiff
path: root/src/grep.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-09-23 10:52:12 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-09-23 19:56:24 -0700
commit87c804fade793815eb7eacfacad5f2d22b5da5b2 (patch)
tree1a9655e31914a45a864f599ab8bba6d8bd0cdc59 /src/grep.c
parentb0748fc4affd1cb6d77473f202e67af1a80d9570 (diff)
downloadgrep-87c804fade793815eb7eacfacad5f2d22b5da5b2.tar.gz
grep: fix recently-introduced performance glitch
* src/grep.c (main): Do not double-increment update_patterns. update_patterns increments n_patterns now; do not increment it again, as the incorrect count would hurt performance heuristics later.
Diffstat (limited to 'src/grep.c')
-rw-r--r--src/grep.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/grep.c b/src/grep.c
index 1453b14a..11856d86 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -2881,7 +2881,6 @@ main (int argc, char **argv)
ptrdiff_t patlen = strlen (keys);
keys[patlen] = '\n';
keycc = update_patterns (keys, 0, patlen + 1, "");
- n_patterns++;
}
else
usage (EXIT_TROUBLE);