Permalink
Browse files

Allow 0 offsets and limits.

  • Loading branch information...
1 parent e2669df commit 7a595bd25e9bbb261b136031347efe37c432da79 @mmcgrana committed Sep 19, 2010
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/clj/fleetdb/lint.clj
View
10 src/clj/fleetdb/lint.clj
@@ -40,9 +40,9 @@
(lint map? r "record not a map")
(domap lint-prop r))
-(defn- lint-pos-int [i type]
- (lint #(and (integer? %) (pos? %)) i
- (str type " not a positive integer")))
+(defn- lint-non-neg-int [i type]
+ (lint #(and (integer? %) (not (neg? %))) i
+ (str type " not a non-negative integer")))
(defn- lint-order-comp [order-comp]
(lint vector? order-comp "order component not a vector")
@@ -109,8 +109,8 @@
(lint map? opts "options not a map")
(doseq [[opt-name opt-val] opts]
(condp = opt-name
- "limit" (lint-pos-int opt-val "limit")
- "offset" (lint-pos-int opt-val "offset")
+ "limit" (lint-non-neg-int opt-val "limit")
+ "offset" (lint-non-neg-int opt-val "offset")
"order" (lint-order opt-val)
"where" (lint-where opt-val)
"only"

0 comments on commit 7a595bd

Please sign in to comment.