branch: elpa/buttercup
commit 5d1f338a67a2ed94412d2c69f52a845ca9c752f7
Author: Ryan C. Thompson <r...@thompsonclan.org>
Commit: Jorgen Schäfer <jorgen.schae...@gmail.com>

    Move let-binding outside loop for efficiency
---
 buttercup.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index ba56130..567f24f 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1218,13 +1218,13 @@ current directory."
     (dolist (file command-line-args-left)
       (with-current-buffer (find-file-noselect file)
         (goto-char (point-min))
-        (while (let ((case-fold-search t))
-                 (re-search-forward
+        (let ((case-fold-search t))
+          (while (re-search-forward
                   "```\\(?:emacs-\\|e\\)?lisp\n\\(\\(?:.\\|\n\\)*?\\)```"
-                  nil t))
-          (let ((code (match-string 1)))
-            (with-current-buffer lisp-buffer
-              (insert code))))))
+                  nil t)
+            (let ((code (match-string 1)))
+              (with-current-buffer lisp-buffer
+                (insert code)))))))
     (with-current-buffer lisp-buffer
       (setq lexical-binding t)
       (eval-region (point-min)

Reply via email to