From 6bdb959204f723cc1de6628809ae24b58a19b8cf Mon Sep 17 00:00:00 2001 From: Pierre Chambart Date: Tue, 24 Apr 2018 14:46:44 +0200 Subject: [PATCH] Really get rid of magic... --- src/lib_stdlib/hashPtree.ml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib_stdlib/hashPtree.ml b/src/lib_stdlib/hashPtree.ml index 265d722b7..3d9887b69 100644 --- a/src/lib_stdlib/hashPtree.ml +++ b/src/lib_stdlib/hashPtree.ml @@ -248,9 +248,8 @@ end = struct let empty = Empty - (* Is there a better way to do ? *) - let equal (x:'a t) (y:'b t) = - (Obj.magic x) == (Obj.magic y) + let equal (x:not_empty t) (y:not_empty t) = + x == y let fast_partial_equal = equal @@ -330,8 +329,8 @@ end = struct | _, _ -> false - let fast_partial_equal (x:'a t) (y:'b t) = - (Obj.magic x) == (Obj.magic y) + let fast_partial_equal (x:not_empty t) (y:not_empty t) = + x == y end [@@inline]