summaryrefslogtreecommitdiff
path: root/stdlib/queue.ml
diff options
context:
space:
mode:
authorLuc Maranget <luc.maranget@inria.fr>2014-03-13 15:03:16 +0000
committerLuc Maranget <luc.maranget@inria.fr>2014-03-13 15:03:16 +0000
commit1338d73c180d22cd2fd2abc5b46554a56f66b1f5 (patch)
tree1d7171e373a49abdbac5bc790f896aadbca27718 /stdlib/queue.ml
parent18e6a3781be059367bfff403aa8a41e9dc200844 (diff)
downloadocaml-jo401.tar.gz
Merge jo401 w.r.t ocaml/4.01 from 13776 to 14115jo401
Plus ld.conf changes git-svn-id: http://caml.inria.fr/svn/ocaml/branches/jo401@14458 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/queue.ml')
-rw-r--r--stdlib/queue.ml13
1 files changed, 7 insertions, 6 deletions
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'