]> Savannah Git Hosting - gnulib.git/commitdiff
dfa: minor performance tweak
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 30 Dec 2016 07:02:45 +0000 (23:02 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 30 Dec 2016 09:02:50 +0000 (01:02 -0800)
* lib/dfa.c (setbit_wc): Test < 0, not == EOF.

ChangeLog
lib/dfa.c

index 27ee0406390018882e4d419431c6707f23c66d5b..6d372124b3f5083607a522577b255e35c2941aeb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-12-30  Paul Eggert  <eggert@cs.ucla.edu>
 
+       dfa: minor performance tweak
+       * lib/dfa.c (setbit_wc): Test < 0, not == EOF.
+
        dfa: wrap charclass inside a struct
        On my platform (gcc Ubuntu 5.4.0-6ubuntu1~16.04.4 x86-64,
        en_US.utf8 locale) this makes 'grep -Fi -f list.txt list.txt >out'
index a4ccf8c25a416573b09d010e8fb0aeb88c0d98b7..cdc4787ec2ced20581197d4e91cfc71aabb5cfd9 100644 (file)
--- a/lib/dfa.c
+++ b/lib/dfa.c
@@ -851,7 +851,7 @@ static bool
 setbit_wc (wint_t wc, charclass *c)
 {
   int b = wctob (wc);
-  if (b == EOF)
+  if (b < 0)
     return false;
 
   setbit (b, c);