]> granicus.if.org Git - flex/commit
scanner: compute powers of two faster.
authorExplorer09 <explorer09@gmail.com>
Sun, 12 Feb 2017 11:59:52 +0000 (19:59 +0800)
committerWill Estes <westes575@gmail.com>
Thu, 16 Feb 2017 18:26:21 +0000 (13:26 -0500)
commitc7a545ae0907c81cf52139dd391659586570f60c
treeedf686d64f473abea392aee425521a22116d9f11
parent122e58965acaf67386d1fc6893f069bd27e5aa26
scanner: compute powers of two faster.

Replace the naive "for" loop in determining power of two with a clever
bitwise solution. This code is around the Internet already and is in
Public Domain.
src/dfa.c
src/flexdef.h