summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2022-11-07 15:13:04 +0200
committerIgor Pashev <pashev.igor@gmail.com>2022-11-07 16:48:05 +0200
commit6c0c8fb05214d1cf631f5aad657e38195ae88c95 (patch)
treed7eddf833b6494b7dcbeb6e87bdef53b18f01f53
parent51e22a9a559a9961f43875c68f099540ffae0c6d (diff)
downloadgcd-6c0c8fb05214d1cf631f5aad657e38195ae88c95.tar.gz
Clojure: use recur
-rw-r--r--gcd.clj2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcd.clj b/gcd.clj
index 7cee3c3..5296997 100644
--- a/gcd.clj
+++ b/gcd.clj
@@ -12,7 +12,7 @@
(defn gcd2 [a b]
(if (zero? b)
a
- (gcd2 b (mod a b))))
+ (recur b (mod a b))))
(defn gcdn [aa] (reduce gcd2 aa))