From 5721fcc224d0f5d7ab5df91c5727c1626c02b2ad Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Tue, 6 Dec 2022 17:48:30 +0100 Subject: [PATCH] Fix of string function. --- lib/std/core/string.c3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/core/string.c3 b/lib/std/core/string.c3 index 6f25a3ce9..816abccf2 100644 --- a/lib/std/core/string.c3 +++ b/lib/std/core/string.c3 @@ -297,7 +297,7 @@ private fn void String.reserve(String* str, usz addition) } usz len = data.len + addition; if (data.capacity >= len) return; - usz new_capacity = data.capacity * 2; + usz new_capacity = data.capacity *= 2; if (new_capacity < MIN_CAPACITY) new_capacity = MIN_CAPACITY; *str = (String)data.allocator.realloc(data, StringData.sizeof + new_capacity)!!; }