Faster grep pattern for identifiers
* lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search): Use the `-w` flag instead of wrapping the pattern in regexps that make matching much slower. This speeds up `xref-find-references` by about 3× on macOS.
This commit is contained in:
parent
83557511a7
commit
544db1ee86
1 changed files with 2 additions and 9 deletions
|
@ -150,15 +150,8 @@ This shell should support pipe redirect syntax."
|
|||
"-l ")
|
||||
((eq (oref tool searchtype) 'regexp)
|
||||
"-nE ")
|
||||
(t "-n ")))
|
||||
(greppat (cond ((eq (oref tool searchtype) 'regexp)
|
||||
(oref tool searchfor))
|
||||
(t
|
||||
;; Can't use the word boundaries: Grep
|
||||
;; doesn't always agree with the language
|
||||
;; syntax on those.
|
||||
(format "\\(^\\|\\W\\)%s\\(\\W\\|$\\)"
|
||||
(oref tool searchfor)))))
|
||||
(t "-nw ")))
|
||||
(greppat (oref tool searchfor))
|
||||
;; Misc
|
||||
(b (get-buffer-create "*Semantic SymRef*"))
|
||||
(ans nil)
|
||||
|
|
Loading…
Add table
Reference in a new issue