emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/osm 305aea000b 03/77: Use cl-loop


From: ELPA Syncer
Subject: [elpa] externals/osm 305aea000b 03/77: Use cl-loop
Date: Mon, 7 Mar 2022 08:58:03 -0500 (EST)

branch: externals/osm
commit 305aea000bcf6a09c5148feabd1ca72c7b7e1a30
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Use cl-loop
---
 osm.el | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/osm.el b/osm.el
index df44d9c753..19f4141c89 100644
--- a/osm.el
+++ b/osm.el
@@ -196,18 +196,16 @@ Should be at least 7 days according to the server usage 
policies."
   "Zoom N times into the map."
   (interactive "p")
   (setq n (or n 1))
-  (while (> n 0)
-    (when (< osm--zoom (osm--server-property :max-zoom))
-      (setq osm--zoom (1+ osm--zoom)
-            osm--x (* osm--x 2)
-            osm--y (* osm--y 2)))
-    (cl-decf n))
-  (while (< n 0)
-    (when (> osm--zoom (osm--server-property :min-zoom))
-      (setq osm--zoom (1- osm--zoom)
-            osm--x (/ osm--x 2)
-            osm--y (/ osm--y 2)))
-    (cl-incf n))
+  (cl-loop for i from n above 0
+           if (< osm--zoom (osm--server-property :max-zoom)) do
+           (setq osm--zoom (1+ osm--zoom)
+                 osm--x (* osm--x 2)
+                 osm--y (* osm--y 2)))
+  (cl-loop for i from n below 0
+           if (> osm--zoom (osm--server-property :min-zoom)) do
+           (setq osm--zoom (1- osm--zoom)
+                 osm--x (/ osm--x 2)
+                 osm--y (/ osm--y 2)))
   (osm--update))
 
 (defun osm-smaller (&optional n)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]