(gnus-summary-remove-list-identifiers): Don't cons
authorJesper Harder <harder@ifa.au.dk>
Sun, 11 Jan 2004 18:31:48 +0000 (18:31 +0000)
committerJesper Harder <harder@ifa.au.dk>
Sun, 11 Jan 2004 18:31:48 +0000 (18:31 +0000)
a new string in every iteration.  Use shy groups.

lisp/ChangeLog
lisp/gnus-sum.el

index b0d0850..93039aa 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-11  Jesper Harder  <harder@ifa.au.dk>
+
+       * gnus-sum.el (gnus-summary-remove-list-identifiers): Don't cons
+       a new string in every iteration.  Use shy groups.
+
 2004-01-10  Jesper Harder  <harder@ifa.au.dk>
 
        * gnus-start.el (gnus-subscribe-newsgroup, gnus-start-draft-setup)
index 592bd34..9619089 100644 (file)
@@ -4962,23 +4962,20 @@ or a straight list of headers."
                  gnus-list-identifiers))
        changed subject)
     (when regexp
+      (setq regexp (concat "^\\(?:R[Ee]: +\\)*\\(" regexp " *\\)"))
       (dolist (header gnus-newsgroup-headers)
        (setq subject (mail-header-subject header)
              changed nil)
-       (while (string-match
-               (concat "^\\(R[Ee]: +\\)*\\(" regexp " *\\)")
-               subject)
+       (while (string-match regexp subject)
          (setq subject
-               (concat (substring subject 0 (match-beginning 2))
+               (concat (substring subject 0 (match-beginning 1))
                        (substring subject (match-end 0)))
                changed t))
-       (when (and changed
-                  (string-match
-                   "^\\(\\(R[Ee]: +\\)+\\)R[Ee]: +" subject))
-         (setq subject
-               (concat (substring subject 0 (match-beginning 1))
-                       (substring subject (match-end 1)))))
        (when changed
+         (when (string-match "^\\(\\(?:R[Ee]: +\\)+\\)R[Ee]: +" subject)
+           (setq subject
+                 (concat (substring subject 0 (match-beginning 1))
+                         (substring subject (match-end 1)))))
          (mail-header-set-subject header subject))))))
 
 (defun gnus-fetch-headers (articles)