[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r110862: * lisp/ido.el (ido-set-match
From: |
Leo Liu |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r110862: * lisp/ido.el (ido-set-matches-1): Improve flex matching performance by |
Date: |
Sat, 10 Nov 2012 09:28:22 +0800 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 110862
fixes bug: http://debbugs.gnu.org/12796
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Sat 2012-11-10 09:28:22 +0800
message:
* lisp/ido.el (ido-set-matches-1): Improve flex matching performance by
removing backtracking in the regexp (suggested by Stefan).
modified:
lisp/ChangeLog
lisp/ido.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-11-09 22:20:47 +0000
+++ b/lisp/ChangeLog 2012-11-10 01:28:22 +0000
@@ -1,3 +1,8 @@
+2012-11-10 Leo Liu <address@hidden>
+
+ * ido.el (ido-set-matches-1): Improve flex matching performance by
+ removing backtracking in the regexp (suggested by Stefan). (Bug#12796)
+
2012-11-09 Stefan Monnier <address@hidden>
* emacs-lisp/advice.el (ad-set-advice-info): Set defalias-fset-function.
=== modified file 'lisp/ido.el'
--- a/lisp/ido.el 2012-10-05 07:38:05 +0000
+++ b/lisp/ido.el 2012-11-10 01:28:22 +0000
@@ -3764,7 +3764,11 @@
ido-enable-flex-matching
(> (length ido-text) 1)
(not ido-enable-regexp))
- (setq re (mapconcat #'regexp-quote (split-string ido-text "") ".*"))
+ (setq re (concat (regexp-quote (string (aref ido-text 0)))
+ (mapconcat (lambda (c)
+ (concat "[^" (string c) "]*"
+ (regexp-quote (string c))))
+ (substring ido-text 1) "")))
(if ido-enable-prefix
(setq re (concat "\\`" re)))
(mapc
- [Emacs-diffs] /srv/bzr/emacs/trunk r110862: * lisp/ido.el (ido-set-matches-1): Improve flex matching performance by,
Leo Liu <=