aboutsummaryrefslogtreecommitdiff
path: root/lib/deque.ml
diff options
context:
space:
mode:
authorppedrot2012-11-08 17:11:59 +0000
committerppedrot2012-11-08 17:11:59 +0000
commitb0b1710ba631f3a3a3faad6e955ef703c67cb967 (patch)
tree9d35a8681cda8fa2dc968535371739684425d673 /lib/deque.ml
parentbafb198e539998a4a64b2045a7e85125890f196e (diff)
Monomorphized a lot of equalities over OCaml integers, thanks to
the new Int module. Only the most obvious were removed, so there are a lot more in the wild. This may sound heavyweight, but it has two advantages: 1. Monomorphization is explicit, hence we do not miss particular optimizations of equality when doing it carelessly with the generic equality. 2. When we have removed all the generic equalities on integers, we will be able to write something like "let (=) = ()" to retrieve all its other uses (mostly faulty) spread throughout the code, statically. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15957 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/deque.ml')
-rw-r--r--lib/deque.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/deque.ml b/lib/deque.ml
index 58049b0949..335a1a2673 100644
--- a/lib/deque.ml
+++ b/lib/deque.ml
@@ -17,9 +17,9 @@ type 'a t = {
let rec split i accu l = match l with
| [] ->
- if i = 0 then (accu, []) else invalid_arg "split"
+ if Int.equal i 0 then (accu, []) else invalid_arg "split"
| t :: q ->
- if i = 0 then (accu, l)
+ if Int.equal i 0 then (accu, l)
else split (pred i) (t :: accu) q
let balance q =
@@ -88,7 +88,7 @@ let rev q = {
let length q = q.lenf + q.lenr
-let is_empty q = length q = 0
+let is_empty q = Int.equal (length q) 0
let filter f q =
let fold (accu, len) x = if f x then (x :: accu, succ len) else (accu, len) in