Skip to content

Commit 331db3f

Browse files
committed
Use char-after instead of buffer-substring in toggle-keyword-string
Replace verbose buffer-substring-no-properties single-char comparisons with direct char-after calls, and use = instead of equal for the numeric point comparison.
1 parent a7299da commit 331db3f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

clojure-mode.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,15 +2005,15 @@ nil."
20052005
(interactive)
20062006
(let ((original-point (point)))
20072007
(while (and (> (point) 1)
2008-
(not (equal "\"" (buffer-substring-no-properties (point) (+ 1 (point)))))
2009-
(not (equal ":" (buffer-substring-no-properties (point) (+ 1 (point))))))
2008+
(not (eq ?\" (char-after)))
2009+
(not (eq ?: (char-after))))
20102010
(backward-char))
20112011
(cond
2012-
((equal 1 (point))
2012+
((= 1 (point))
20132013
(error "Beginning of file reached, this was probably a mistake"))
2014-
((equal "\"" (buffer-substring-no-properties (point) (+ 1 (point))))
2014+
((eq ?\" (char-after))
20152015
(insert ":" (substring (clojure-delete-and-extract-sexp) 1 -1)))
2016-
((equal ":" (buffer-substring-no-properties (point) (+ 1 (point))))
2016+
((eq ?: (char-after))
20172017
(insert "\"" (substring (clojure-delete-and-extract-sexp) 1) "\"")))
20182018
(goto-char original-point)))
20192019

0 commit comments

Comments
 (0)