branch: elpa/isl
commit 7a7e3a29dff7d159565a6d1ed8fb97e28dde6db8
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Cleaner loop to consume iterators
---
 isl.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/isl.el b/isl.el
index 756065cefbc..0a99e98e6e6 100644
--- a/isl.el
+++ b/isl.el
@@ -333,9 +333,8 @@ It put overlay on current position, move to next overlay 
using
   (with-selected-window (minibuffer-selected-window)
     (isl--highlight-last-overlay 'isl-match)
     (when isl--iterator
-      ;; This is a noop when ARG==1 i.e. (1- 1) == 0.
-      (cl-loop repeat (1- arg) do (isl-iter-next isl--iterator))
-      (isl--goto-overlay (isl-iter-next isl--iterator)))
+      (cl-loop with ov repeat arg do (setq ov (isl-iter-next isl--iterator))
+               finally (isl--goto-overlay ov)))
     (isl-setup-mode-line)))
 
 (defun isl-scroll-1 (arg)

Reply via email to