# HG changeset patch # User Stefan Monnier # Date 1209059991 0 # Node ID 52fb31c78b25f34359edafc6960b721b6d8b730f # Parent 22f1fdbf5cde99b39361a0e3da34767a1fc7c13b (isearch-search-string): Avoid string-bytes and aset. diff -r 22f1fdbf5cde -r 52fb31c78b25 lisp/ChangeLog --- a/lisp/ChangeLog Thu Apr 24 17:59:13 2008 +0000 +++ b/lisp/ChangeLog Thu Apr 24 17:59:51 2008 +0000 @@ -1,5 +1,7 @@ 2008-04-24 Stefan Monnier + * isearch.el (isearch-search-string): Avoid string-bytes and aset. + * international/quail.el (quail-build-decode-map): Avoid string-bytes. * textmodes/ispell.el (ispell-dictionary-alist-1) diff -r 22f1fdbf5cde -r 52fb31c78b25 lisp/isearch.el --- a/lisp/isearch.el Thu Apr 24 17:59:13 2008 +0000 +++ b/lisp/isearch.el Thu Apr 24 17:59:51 2008 +0000 @@ -2137,13 +2137,15 @@ pos1 pos2) (setq pos1 (save-excursion (funcall func string bound noerror))) (if (and (char-table-p translation-table-for-input) - (> (string-bytes string) len)) - (let (translated match-data) - (dotimes (i len) - (let ((x (aref translation-table-for-input (aref string i)))) - (when x - (or translated (setq translated (copy-sequence string))) - (aset translated i x)))) + (multibyte-string-p string) + ;; Minor optimization. + (string-match-p "[^[:ascii:]]" string)) + (let ((translated + (apply 'string + (mapcar (lambda (c) + (or (aref translation-table-for-input c) c)) + string))) + match-data) (when translated (save-match-data (save-excursion