diff options
Diffstat (limited to 'lib/bstack.ml')
-rw-r--r-- | lib/bstack.ml | 8 |
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))) |