use array_is_empty_ instead of direct check

This commit is contained in:
Fardale 2019-12-14 16:55:33 +01:00 committed by Simon Cruanes
parent 858616606b
commit 1d589cf4ac

View file

@ -145,14 +145,14 @@ let ensure_assuming_not_empty_ 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
) else (
ensure_assuming_not_empty_ 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
)