* mm-util.el (mm-subst-char-in-string): Support inplace.
authorJesper Harder <harder@ifa.au.dk>
Sun, 11 Jan 2004 21:27:31 +0000 (21:27 +0000)
committerJesper Harder <harder@ifa.au.dk>
Sun, 11 Jan 2004 21:27:31 +0000 (21:27 +0000)
* gnus-sum.el (gnus-summary-remove-list-identifiers): Don't cons
a new string in every iteration.  Use shy groups.

lisp/ChangeLog
lisp/gnus-sum.el
lisp/mm-util.el

index 93039aa..c9d4fe3 100644 (file)
@@ -1,5 +1,10 @@
 2004-01-11  Jesper Harder  <harder@ifa.au.dk>
 
+       * gnus.sum.el (gnus-remove-odd-characters): Don't cons two new
+       strings.
+
+       * mm-util.el (mm-subst-char-in-string): Support inplace.        
+
        * gnus-sum.el (gnus-summary-remove-list-identifiers): Don't cons
        a new string in every iteration.  Use shy groups.
 
index 9619089..24fdee3 100644 (file)
@@ -3984,8 +3984,7 @@ Returns HEADER if it was entered in the DEPENDENCIES.  Returns nil otherwise."
   "Translate STRING into something that doesn't contain weird characters."
   (mm-subst-char-in-string
    ?\r ?\-
-   (mm-subst-char-in-string
-    ?\n ?\- string)))
+   (mm-subst-char-in-string ?\n ?\- string t) t))
 
 ;; This function has to be called with point after the article number
 ;; on the beginning of the line.
index b560d09..bceeb69 100644 (file)
                    mm-mime-mule-charset-alist)
            nil t))))
      (subst-char-in-string
-      . (lambda (from to string) ;; stolen (and renamed) from nnheader.el
-         "Replace characters in STRING from FROM to TO."
-         (let ((string (substring string 0)) ;Copy string.
+      . (lambda (from to string &optional inplace) ;; stolen (and renamed) from nnheader.el
+         "Replace characters in STRING from FROM to TO.
+         Unless optional argument INPLACE is non-nil, return a new string."
+         (let ((string (if inplace string (copy-sequence string)))
                (len (length string))
                (idx 0))
            ;; Replace all occurrences of FROM with TO.