mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
use array_is_empty_ instead of direct check
This commit is contained in:
parent
858616606b
commit
1d589cf4ac
1 changed files with 2 additions and 2 deletions
|
|
@ -145,14 +145,14 @@ let ensure_assuming_not_empty_ v ~size =
|
||||||
)
|
)
|
||||||
|
|
||||||
let ensure_with ~init v size =
|
let ensure_with ~init v size =
|
||||||
if Array.length v.vec = 0 then (
|
if array_is_empty_ v then (
|
||||||
v.vec <- Array.make size init
|
v.vec <- Array.make size init
|
||||||
) else (
|
) else (
|
||||||
ensure_assuming_not_empty_ v ~size
|
ensure_assuming_not_empty_ v ~size
|
||||||
)
|
)
|
||||||
|
|
||||||
let ensure v size =
|
let ensure v size =
|
||||||
if Array.length v.vec > 0 then (
|
if not (array_is_empty_ v) then (
|
||||||
ensure_assuming_not_empty_ v ~size
|
ensure_assuming_not_empty_ v ~size
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue