]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Optimize appending text.
authorEric Blake <ebb9@byu.net>
Wed, 3 Oct 2007 02:23:03 +0000 (20:23 -0600)
committerEric Blake <ebb9@byu.net>
Wed, 3 Oct 2007 02:23:03 +0000 (20:23 -0600)
* lib/m4sugar/m4sugar.m4 (m4_append_uniq): Use index, not regular
expressions.

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

index 13aa85a7fd393833361e44a7b94e95b6080eea9a..26833bc817c3738c47e8c1814b0edc682d90ece4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 7b20095144ba427e82a06bff4ebb221138182e41..f180e8792f78744437df3f231a1773bbb7f703f9 100644 (file)
@@ -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($@)])])