Skip to content

Commit

Permalink
string-suffix-p is faster than regexp matching
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiase committed Jul 14, 2024
1 parent 07666b7 commit 9cb20f8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions relint.el
Original file line number Diff line number Diff line change
Expand Up @@ -2309,12 +2309,10 @@ directly."
(symbol-name name))
(relint--check-alist-any re-arg name pos (cons 2 path))
(push name relint--checked-variables))
((string-match-p (rx "-mode-alist" eos)
(symbol-name name))
((string-suffix-p "-mode-alist" (symbol-name name))
(relint--check-list-any re-arg name pos (cons 2 path))
(push name relint--checked-variables))
((string-match-p (rx "-rules-list" eos)
(symbol-name name))
((string-suffix-p "-rules-list" (symbol-name name))
(relint--check-rules-list re-arg name pos (cons 2 path))
(push name relint--checked-variables))
((string-match-p (rx (or (seq (or bos ?-) "treesit")
Expand Down

0 comments on commit 9cb20f8

Please sign in to comment.