Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simplify the clipValue code using mod

  • Loading branch information...
commit c8ce5eb3aec715b5d950f60d780356206a2fd23e 1 parent 57c9078
@palfrey authored
Showing with 1 addition and 7 deletions.
  1. +1 −7 src/clostridium/core.clj
View
8 src/clostridium/core.clj
@@ -88,13 +88,7 @@
(def maxValue Integer/MAX_VALUE)
(defn clipValue [val]
- (if (>= val 0)
- (if (>= val maxValue)
- (- val maxValue)
- val
- )
- (+ maxValue val)
- )
+ (mod val maxValue)
)
(defn current
Please sign in to comment.
Something went wrong with that request. Please try again.