]> Savannah Git Hosting - gnulib.git/commit
dfa: tweak allocation performance
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 19 Sep 2018 02:05:26 +0000 (19:05 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 19 Sep 2018 02:16:53 +0000 (19:16 -0700)
commit28d7f171a7ac284c2377793559d55e887610fcc8
tree3dae37a1933c10ada486c016bd850d389f940b1a
parentcbf5523bd54a92c1d8ffeae4b629d2b82651f651
dfa: tweak allocation performance

* lib/dfa.c (merge_nfa_state, dfaoptimize):
Prefer ptrdiff_t for indexes some more.
Use char for flags, as it’s wide enough.
Allocate queue and flags together, with one malloc call.
No need to use xnmalloc since the multiplication and
addition cannot overflow (it’s already been checked by
earlier allocation).  Prefer memset to open-coding.
ChangeLog
lib/dfa.c