diff options
| author | ap29600 <66381278+ap29600@users.noreply.github.com> | 2022-02-05 18:46:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-05 18:46:25 +0100 |
| commit | 697f8c7ee6ef3d0af4d8e44163e770ef1f2227c5 (patch) | |
| tree | b32eeb1365851ab7977ae5721ae2995c3ecb2ed7 /core/container/bit_array/bit_array.odin | |
| parent | b6ebfe4b2c1445f59ed35c20bf8d4ba8910b59de (diff) | |
replace a branch with `max` in `core:container/bit_array.set`
Diffstat (limited to 'core/container/bit_array/bit_array.odin')
| -rw-r--r-- | core/container/bit_array/bit_array.odin | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/container/bit_array/bit_array.odin b/core/container/bit_array/bit_array.odin index 5fbac69af..5eebe1bcb 100644 --- a/core/container/bit_array/bit_array.odin +++ b/core/container/bit_array/bit_array.odin @@ -178,7 +178,7 @@ set :: proc(ba: ^Bit_Array, #any_int index: uint, allocator := context.allocator resize_if_needed(ba, leg_index) or_return - if idx > ba.max_index { ba.max_index = idx } + ba.max_index = max(idx, ba.max_index) ba.bits[leg_index] |= 1 << uint(bit_index) return true } |