[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/4] dfa: minor performance tweak
From: |
Paul Eggert |
Subject: |
[PATCH 2/4] dfa: minor performance tweak |
Date: |
Fri, 30 Dec 2016 01:03:20 -0800 |
* lib/dfa.c (setbit_wc): Test < 0, not == EOF.
---
ChangeLog | 3 +++
lib/dfa.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 27ee040..6d37212 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2016-12-30 Paul Eggert <address@hidden>
+ 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'
diff --git a/lib/dfa.c b/lib/dfa.c
index a4ccf8c..cdc4787 100644
--- 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);
--
2.7.4