aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArnaud Spiwack2014-02-24 16:26:34 +0100
committerArnaud Spiwack2014-02-24 16:26:34 +0100
commit1bb2ee934bc2082865ee64f539497f3bc292a439 (patch)
tree552e0835f4cf2f5af0cb0e39ef44a0746d35885a /lib
parent03d5cf5686e9ea5448ee5e4901792130d9527a74 (diff)
IStream: remove a useless Obj.magic.
Lazy.lazy_from_val does almost the same thing as this Obj.magic. It makes some extra dynamic check, but it's frankly unlikely that it could be observed.
Diffstat (limited to 'lib')
-rw-r--r--lib/iStream.ml8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/iStream.ml b/lib/iStream.ml
index ba08ffd24e..65a336dafd 100644
--- a/lib/iStream.ml
+++ b/lib/iStream.ml
@@ -14,13 +14,9 @@ type 'a node = ('a,'a t) peek
and 'a t = 'a node Lazy.t
-let lift (n : 'a node) : 'a t = Obj.magic n
-(** Small hack to overcome a missing optimization in OCaml compilation of lazy
- values. *)
+let empty = Lazy.lazy_from_val Nil
-let empty = lift Nil
-
-let cons x s = lift (Cons (x, s))
+let cons x s = Lazy.lazy_from_val (Cons (x, s))
let thunk s = lazy (Lazy.force (Lazy.force s))