mirror of
git://git.sv.gnu.org/autoconf
synced 2025-02-11 13:51:04 +08:00
Optimize appending text.
* lib/m4sugar/m4sugar.m4 (m4_append_uniq): Use index, not regular expressions. Signed-off-by: Eric Blake <ebb9@byu.net>
This commit is contained in:
parent
57e51969f0
commit
53b2e90b42
@ -1,5 +1,9 @@
|
||||
2007-10-02 Eric Blake <ebb9@byu.net>
|
||||
|
||||
Optimize appending text.
|
||||
* lib/m4sugar/m4sugar.m4 (m4_append_uniq): Use index, not regular
|
||||
expressions.
|
||||
|
||||
Optimize recursion.
|
||||
* lib/m4sugar/m4sugar.m4 (m4_shiftn): This macro is called in a
|
||||
lot of hot spots; optimize it for 2 and 3 shifts.
|
||||
|
@ -1553,11 +1553,11 @@ m4_define([m4_append],
|
||||
|
||||
# m4_append_uniq(MACRO-NAME, STRING, [SEPARATOR])
|
||||
# -----------------------------------------------
|
||||
# As `m4_append', but append only if not yet present.
|
||||
# Like `m4_append', but append only if not yet present.
|
||||
m4_define([m4_append_uniq],
|
||||
[m4_ifdef([$1],
|
||||
[m4_bmatch([$3]m4_defn([$1])[$3], m4_re_escape([$3$2$3]), [],
|
||||
[m4_append($@)])],
|
||||
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
|
||||
[m4_append($@)])],
|
||||
[m4_append($@)])])
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user