Speed optimization: avoid m4 regex when other algorithms work.
commitb2dda0adc778b0d3004950048211289958da2abc
authorEric Blake <ebb9@byu.net>
Sun, 30 Sep 2007 03:44:10 +0000 (29 21:44 -0600)
committerEric Blake <ebb9@byu.net>
Sun, 30 Sep 2007 03:44:10 +0000 (29 21:44 -0600)
tree5a4953c7526460fb536a1c3147af08ea366ead04
parent36556808639efb06026da2e8485756d109e53292
Speed optimization: avoid m4 regex when other algorithms work.

* lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Rewrite without regex.
(_AS_QUOTE_IFELSE): Likewise.
* lib/m4sugar/m4sugar.m4 (m4_strip): Reduce from 3 to 2 regex.
(m4_bpatsubsts): Split...
(_m4_bpatsubsts): ...so that recursion can avoid patsubst on empty
regex.
(_m4_divert()): Define, to avoid m4 warning on `m4_divert'.
(m4_qlen): Optimize on short strings, to avoid regex.
(m4_sign): Avoid regex, and fix bug with `01' and `-0'.
* lib/autoconf/general.m4 (AC_CACHE_VAL): Rewrite without regex.
(AC_DEFINE_TRACE): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/autoconf/general.m4
lib/m4sugar/m4sh.m4
lib/m4sugar/m4sugar.m4