mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Merge pull request #3808 from karl-zylinski/fix-append-elem-max-confusion
Replace `max(8, 1)` in _append_elem with just `8` and a comment.
This commit is contained in:
@@ -423,7 +423,8 @@ _append_elem :: #force_inline proc(array: ^$T/[dynamic]$E, arg: E, should_zero:
|
|||||||
return 1, nil
|
return 1, nil
|
||||||
} else {
|
} else {
|
||||||
if cap(array) < len(array)+1 {
|
if cap(array) < len(array)+1 {
|
||||||
cap := 2 * cap(array) + max(8, 1)
|
// Same behavior as _append_elems but there's only one arg, so we always just add 8.
|
||||||
|
cap := 2 * cap(array) + 8
|
||||||
|
|
||||||
// do not 'or_return' here as it could be a partial success
|
// do not 'or_return' here as it could be a partial success
|
||||||
if should_zero {
|
if should_zero {
|
||||||
|
|||||||
Reference in New Issue
Block a user