branch: externals/shift-number
commit 9b9e2a7c514205c6172afc8743462e4d55764493
Author: Campbell Barton <[email protected]>
Commit: Campbell Barton <[email protected]>

    Cleanup: replace `if` with `cond`
---
 shift-number.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/shift-number.el b/shift-number.el
index 788cb18e85..ad87a0e732 100644
--- a/shift-number.el
+++ b/shift-number.el
@@ -80,17 +80,21 @@ the current line and change it."
            (end (match-end 1))
            (sign
             (and shift-number-negative
-                 (if (eq ?- (char-before beg))
-                     -1
-                   1)))
+                 (cond
+                  ((eq ?- (char-before beg))
+                   -1)
+                  (t
+                   1))))
            (old-num-str (buffer-substring-no-properties beg end))
            (old-num (string-to-number old-num-str))
            (new-num (+ old-num (* sign n)))
            (new-num-str (number-to-string (abs new-num))))
       (delete-region
-       (if (eq sign -1)
-           (1- beg)
-         beg)
+       (cond
+        ((eq sign -1)
+         (1- beg))
+        (t
+         beg))
        end)
 
       ;; Handle sign flipping & negative numbers.

Reply via email to