[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 0d57643: * lisp/character-fold.el: Comment out br
From: |
Artur Malabarba |
Subject: |
[Emacs-diffs] emacs-25 0d57643: * lisp/character-fold.el: Comment out branching code |
Date: |
Mon, 30 Nov 2015 15:06:05 +0000 |
branch: emacs-25
commit 0d576434a8fdbe32e0bc984b21fc20403acff812
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
* lisp/character-fold.el: Comment out branching code
(character-fold-to-regexp): Comment out code that uses multi-char
table. The branching caused by this induces absurdly long regexps,
up to 10k chars for as little as 25 input characters.
---
lisp/character-fold.el | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/lisp/character-fold.el b/lisp/character-fold.el
index 88622b3..07537d8 100644
--- a/lisp/character-fold.el
+++ b/lisp/character-fold.el
@@ -180,19 +180,19 @@ from which to start."
(regexp-quote (string c))))
(alist nil))
;; Long string. The regexp would probably be too long.
- (unless (> end 50)
- (setq alist (aref multi-char-table c))
- (when case-fold-search
- (let ((other-c (aref lower-case-table c)))
- (when (or (not other-c)
- (eq other-c c))
- (setq other-c (aref upper-case-table c)))
- (when other-c
- (setq alist (append alist (aref multi-char-table
other-c)))
- (setq regexp (concat "\\(?:" regexp "\\|"
- (or (aref character-fold-table
other-c)
- (regexp-quote (string other-c)))
- "\\)"))))))
+ ;; (unless (> end 50)
+ ;; (setq alist (aref multi-char-table c))
+ ;; (when case-fold-search
+ ;; (let ((other-c (aref lower-case-table c)))
+ ;; (when (or (not other-c)
+ ;; (eq other-c c))
+ ;; (setq other-c (aref upper-case-table c)))
+ ;; (when other-c
+ ;; (setq alist (append alist (aref multi-char-table
other-c)))
+ ;; (setq regexp (concat "\\(?:" regexp "\\|"
+ ;; (or (aref character-fold-table
other-c)
+ ;; (regexp-quote (string
other-c)))
+ ;; "\\)"))))))
(push (let ((alist-out '("\\)")))
(pcase-dolist (`(,suffix . ,out-regexp) alist)
(let ((len-suf (length suffix)))
@@ -223,7 +223,7 @@ from which to start."
(push (character-fold--make-space-string spaces) out))
(let ((regexp (apply #'concat (nreverse out))))
;; Limited by `MAX_BUF_SIZE' in `regex.c'.
- (if (> (length regexp) 32000)
+ (if (> (length regexp) 10000)
(regexp-quote string)
regexp))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 0d57643: * lisp/character-fold.el: Comment out branching code,
Artur Malabarba <=