From f227a406520064b81250960293f4db43844f83a0 Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Tue, 25 Jun 2024 22:48:14 +0200 Subject: [PATCH] Replace `max(8, 1)` in _append_elem with just `8` and a comment. --- base/runtime/core_builtin.odin | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base/runtime/core_builtin.odin b/base/runtime/core_builtin.odin index a9566c831..ff973054d 100644 --- a/base/runtime/core_builtin.odin +++ b/base/runtime/core_builtin.odin @@ -423,7 +423,8 @@ _append_elem :: #force_inline proc(array: ^$T/[dynamic]$E, arg: E, should_zero: return 1, nil } else { 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 if should_zero {