diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-09-12 06:40:08 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-09-12 06:40:08 -0700 |
commit | a4130c6db053fb2f02138ec64652d2a321ef497f (patch) | |
tree | 56ce217d1dbf229cb75863dcb05eab368187e6cb /buf.c | |
parent | 656a69fcefc0787ac0c2e22e8b1750e577c4b759 (diff) | |
download | txr-a4130c6db053fb2f02138ec64652d2a321ef497f.tar.gz txr-a4130c6db053fb2f02138ec64652d2a321ef497f.tar.bz2 txr-a4130c6db053fb2f02138ec64652d2a321ef497f.zip |
regex: elide needless increments of visited counter.
* regex.c (nfa_run): Start with the existing value of the
visited counter and pre-increment it when calling nfa_closure
and nfa_move_closure. Thus it is incremented only as many
times as those functions are called: one fewer than before.
(regex_machine_reset): regm->n.visited is already incremented,
since 1 was added to the prior value; there is no need to
increment it again.
(nfa_handle_wraparound): More prudent approach here.
If we get within 8 increments of wraparound, we
fast forward to UINT_MAX and then 0.
Diffstat (limited to 'buf.c')
0 files changed, 0 insertions, 0 deletions