mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 19:25:28 -05:00
CCRAL: Fixed bug in drop_tree_.
This commit is contained in:
parent
04d10c2711
commit
5b6b71373c
1 changed files with 1 additions and 1 deletions
|
|
@ -337,7 +337,7 @@ and drop_tree_ ~size n t tail = match t with
|
|||
| Node (_,l,r) ->
|
||||
if n=1 then append_tree_ l (append_tree_ r tail)
|
||||
else
|
||||
let size' = size/2 in
|
||||
let size' = if size mod 2 <> 0 then (size/2)+1 else size/2 in
|
||||
if n-1 < size'
|
||||
then drop_tree_ ~size:size' (n-1) l (append_tree_ r tail)
|
||||
else drop_tree_ ~size:size' (n-1-size') r tail
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue