From 1bb2ee934bc2082865ee64f539497f3bc292a439 Mon Sep 17 00:00:00 2001 From: Arnaud Spiwack Date: Mon, 24 Feb 2014 16:26:34 +0100 Subject: 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.--- lib/iStream.ml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib') 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)) -- cgit v1.2.3