From 1338d73c180d22cd2fd2abc5b46554a56f66b1f5 Mon Sep 17 00:00:00 2001 From: Luc Maranget Date: Thu, 13 Mar 2014 15:03:16 +0000 Subject: Merge jo401 w.r.t ocaml/4.01 from 13776 to 14115 Plus ld.conf changes git-svn-id: http://caml.inria.fr/svn/ocaml/branches/jo401@14458 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- stdlib/queue.ml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'stdlib/queue.ml') diff --git a/stdlib/queue.ml b/stdlib/queue.ml index 6d82d25933..fb920d8c9c 100644 --- a/stdlib/queue.ml +++ b/stdlib/queue.ml @@ -107,14 +107,15 @@ let copy q = next = tail' } in - let rec copy cell = - if cell == tail then tail' - else { + let rec copy prev cell = + if cell != tail + then let res = { content = cell.content; - next = copy cell.next - } in + next = tail' + } in prev.next <- res; + copy res cell.next in - tail'.next <- copy tail.next; + copy tail' tail.next; { length = q.length; tail = tail' -- cgit v1.2.1