]> Savannah Git Hosting - gnulib.git/commit
dfa: wrap charclass inside a struct
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 30 Dec 2016 05:44:17 +0000 (21:44 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 30 Dec 2016 09:02:50 +0000 (01:02 -0800)
commit88125b5e13bac7cf31ba3d1de47e0c3ca8d6f1b9
tree699b13d171ec0b7b63f7ddcbecac40bd45afe7e8
parent0d534864bf3324e707957721d4af3c4a0ba69f1a
dfa: wrap charclass inside a struct

This lets GCC check for aliases more accurately.
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'
about 1% faster, where list.txt is generated by 'aspell dump
master | head -n 100000 >list.txt'.  Also, it shrinks the grep
text by 64 bytes, woohoo!  See Bug#22239.
* lib/dfa.c (charclass): Wrap inside a struct.  All uses changed.
(CHARCLASS_INIT, tstbit, setbit, clrbit, zeroset, fillset, notset)
(equal, emptyset, charclass_index, setbit_wc, setbit_case_fold_c):
Adjust to this, e.g., by using charclass * rather than charclass.
All callers changed as needed.
(copyset): Remove.  All uses changed to simple assignment.
(parse_bracket_exp): Use zeroset instead of memset.
ChangeLog
lib/dfa.c