diff --git a/benchs/run_benchs.ml b/benchs/run_benchs.ml index 37789ba6..4448b6a9 100644 --- a/benchs/run_benchs.ml +++ b/benchs/run_benchs.ml @@ -862,7 +862,7 @@ module Deque = struct let take_back d = match !d with | None -> raise Empty - | Some first when first == first.prev -> + | Some first when Pervasives.(==) first first.prev -> (* only one element *) d := None; first.content @@ -875,7 +875,7 @@ module Deque = struct let take_front d = match !d with | None -> raise Empty - | Some first when first == first.prev -> + | Some first when Pervasives.(==) first first.prev -> (* only one element *) d := None; first.content diff --git a/src/data/CCCache.ml b/src/data/CCCache.ml index fce048aa..e8cf3426 100644 --- a/src/data/CCCache.ml +++ b/src/data/CCCache.ml @@ -222,7 +222,7 @@ module LRU(X:HASH) = struct (* take first from queue *) let take_ c = match c.first with - | Some n when n.next == n -> + | Some n when Pervasives.(==) n.next n -> (* last element *) c.first <- None; n @@ -241,7 +241,7 @@ module LRU(X:HASH) = struct n.next <- n; n.prev <- n; c.first <- Some n - | Some n1 when n1==n -> () + | Some n1 when Pervasives.(==) n1 n -> () | Some n1 -> n.prev <- n1.prev; n.next <- n1; diff --git a/src/data/CCDeque.ml b/src/data/CCDeque.ml index 09fff995..7a91f4c7 100644 --- a/src/data/CCDeque.ml +++ b/src/data/CCDeque.ml @@ -163,7 +163,7 @@ let take_back_node_ n = match n.cell with let take_back d = if is_empty d then raise Empty - else if d.cur == d.cur.prev + else if Pervasives.(==) d.cur d.cur.prev then ( (* only one cell *) decr_size_ d; @@ -196,7 +196,7 @@ let take_front_node_ n = match n.cell with let take_front d = if is_empty d then raise Empty - else if d.cur.prev == d.cur + else if Pervasives.(==) d.cur.prev d.cur then ( (* only one cell *) decr_size_ d; @@ -255,7 +255,7 @@ let fold f acc d = | Two (x,y) -> f (f acc x) y | Three (x,y,z) -> f (f (f acc x) y) z in - if n.next == first then acc else aux ~first f acc n.next + if Pervasives.(==) n.next first then acc else aux ~first f acc n.next in aux ~first:d.cur f acc d.cur @@ -337,7 +337,7 @@ let to_gen q = let cell = ref q.cur.cell in let cur = ref q.cur in let rec next () = match !cell with - | Zero when (!cur).next == first -> None + | Zero when Pervasives.(==) (!cur).next first -> None | Zero -> (* go to next node *) let n = !cur in diff --git a/src/data/CCHashTrie.ml b/src/data/CCHashTrie.ml index 05f42840..8d5c93a0 100644 --- a/src/data/CCHashTrie.ml +++ b/src/data/CCHashTrie.ml @@ -24,7 +24,7 @@ module Transient = struct type state = { mutable frozen: bool } type t = Nil | St of state let empty = Nil - let equal a b = a==b + let equal a b = Pervasives.(==) a b let create () = St {frozen=false} let active = function Nil -> false | St st -> not st.frozen let frozen = function Nil -> true | St st -> st.frozen @@ -299,7 +299,7 @@ module Make(Key : KEY) type t = int let make = Key.hash let zero = 0 - let is_0 h = h==0 + let is_0 h = h = 0 let equal (a : int) b = Pervasives.(=) a b let rem h = h land (A.length - 1) let quotient h = h lsr A.length_log diff --git a/src/data/CCIntMap.ml b/src/data/CCIntMap.ml index 014ce91e..52b45527 100644 --- a/src/data/CCIntMap.ml +++ b/src/data/CCIntMap.ml @@ -240,7 +240,7 @@ let update k f t = let doubleton k1 v1 k2 v2 = add k1 v1 (singleton k2 v2) -let rec equal ~eq a b = a==b || match a, b with +let rec equal ~eq a b = Pervasives.(==) a b || match a, b with | E, E -> true | L (ka, va), L (kb, vb) -> ka = kb && eq va vb | N (pa, sa, la, ra), N (pb, sb, lb, rb) -> @@ -290,7 +290,7 @@ let choose t = with Not_found -> None let rec union f t1 t2 = - if t1==t2 then t1 + if Pervasives.(==) t1 t2 then t1 else match t1, t2 with | E, o | o, E -> o | L (k, v), o @@ -345,7 +345,7 @@ let rec union f t1 t2 = *) let rec inter f a b = - if a==b then a + if Pervasives.(==) a b then a else match a, b with | E, _ | _, E -> E | L (k, v), o diff --git a/src/monomorphic/CCMonomorphic.ml b/src/monomorphic/CCMonomorphic.ml index ac3ff290..3817b80a 100644 --- a/src/monomorphic/CCMonomorphic.ml +++ b/src/monomorphic/CCMonomorphic.ml @@ -2,3 +2,5 @@ (* This file is free software, part of containers. See file "license" for more details. *) include Pervasives + +let (==) = `Consider_using_CCEqual_physical diff --git a/src/monomorphic/CCMonomorphic.mli b/src/monomorphic/CCMonomorphic.mli index 5ade3df0..88d98b74 100644 --- a/src/monomorphic/CCMonomorphic.mli +++ b/src/monomorphic/CCMonomorphic.mli @@ -14,3 +14,6 @@ val (>=) : int -> int -> bool val compare : int -> int -> int val min : int -> int -> int val max : int -> int -> int + +val (==) : [`Consider_using_CCEqual_physical] +[@@ocaml.deprecated "Please use CCEqual.physical instead."]