summaryrefslogtreecommitdiff
path: root/lib/bstack.ml
diff options
context:
space:
mode:
authorGravatar Stephane Glondu <steph@glondu.net>2010-07-21 09:46:51 +0200
committerGravatar Stephane Glondu <steph@glondu.net>2010-07-21 09:46:51 +0200
commit5b7eafd0f00a16d78f99a27f5c7d5a0de77dc7e6 (patch)
tree631ad791a7685edafeb1fb2e8faeedc8379318ae /lib/bstack.ml
parentda178a880e3ace820b41d38b191d3785b82991f5 (diff)
Imported Upstream snapshot 8.3~beta0+13298
Diffstat (limited to 'lib/bstack.ml')
-rw-r--r--lib/bstack.ml8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bstack.ml b/lib/bstack.ml
index 35bbf32b..4191ccdb 100644
--- a/lib/bstack.ml
+++ b/lib/bstack.ml
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(* $Id: bstack.ml 10441 2008-01-15 16:37:46Z lmamane $ *)
+(* $Id$ *)
(* Queues of a given length *)
@@ -47,10 +47,10 @@ let push bs e =
incr_size bs;
bs.depth <- bs.depth + 1;
bs.stack.(bs.pos) <- e
-
+
let pop bs =
if bs.size > 1 then begin
- bs.size <- bs.size - 1;
+ bs.size <- bs.size - 1;
bs.depth <- bs.depth - 1;
let oldpos = bs.pos in
decr_pos bs;
@@ -61,7 +61,7 @@ let pop bs =
let top bs =
if bs.size >= 1 then bs.stack.(bs.pos)
else error "Nothing on the stack"
-
+
let app_push bs f =
if bs.size = 0 then error "Nothing on the stack"
else push bs (f (bs.stack.(bs.pos)))