diff options
author | Norihiro Tanaka <noritnk@kcn.ne.jp> | 2016-09-02 00:41:02 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-09-02 00:41:34 -0700 |
commit | 2c0190b809098530e3281fbc4ed1de44e17a65a3 (patch) | |
tree | 9cb6b1ac62ead0e024212fea1e18432cc04fcb5f | |
parent | 10d25bf1807deea5683986c3c158cff021407b6a (diff) | |
download | grep-2c0190b809098530e3281fbc4ed1de44e17a65a3.tar.gz |
dfa: simplify to find state index for state 0
* src/dfa.c (dfastate): Simplify to find state index for state 0.
-rw-r--r-- | src/dfa.c | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -2671,18 +2671,9 @@ dfastate (state_num s, struct dfa *d, state_num trans[]) is to fail miserably. */ if (d->searchflag) { - /* Find the state(s) corresponding to the positions of state 0. */ - copy (&d->states[0].elems, &follows); - separate_contexts = state_separate_contexts (&follows); - state = state_index (d, &follows, separate_contexts ^ CTX_ANY); - if (separate_contexts & CTX_NEWLINE) - state_newline = state_index (d, &follows, CTX_NEWLINE); - else - state_newline = state; - if (separate_contexts & CTX_LETTER) - state_letter = state_index (d, &follows, CTX_LETTER); - else - state_letter = state; + state_newline = 0; + state_letter = d->min_trcount - 1; + state = d->initstate_notbol; for (i = 0; i < NOTCHAR; ++i) trans[i] = unibyte_word_constituent (d, i) ? state_letter : state; |