That would lead to using unnecessary and expensive code paths in dfa.c.
* lib/localeinfo.c (using_simple_locale): Fix recently-introduced logic
error that would have made grep many times slower in the C locale.
With this change, and a file created like this:
yes 00 | head -
10000000 > in
Running grep as follows becomes more than 40 times faster:
LC_ALL=C grep -Fw 0 in
+2019-12-30 Jim Meyering <meyering@fb.com>
+
+ localeinfo: ->simple would be wrong for LC_ALL=C
+ That would lead to using unnecessary and expensive code paths in dfa.c.
+ * lib/localeinfo.c (using_simple_locale): Fix recently-introduced logic
+ error that would have made grep many times slower in the C locale.
+ With this change, and a file created like this:
+ yes 00 | head -10000000 > in
+ Running grep as follows becomes more than 40 times faster:
+ LC_ALL=C grep -Fw 0 in
+
2019-12-30 Paul Eggert <eggert@cs.ucla.edu>
doc: document trouble with back-references
where the native order is the collating-sequence order but there
are multi-character collating elements. */
for (int i = 0; i < UCHAR_MAX; i++)
- if (strcoll (((char []) {i, 0}), ((char []) {i + 1, 0})) <= 0)
+ if (0 <= strcoll (((char []) {i, 0}), ((char []) {i + 1, 0})))
return false;
return true;