aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
authorFourteenBrush <74827262+FourteenBrush@users.noreply.github.com>2025-07-11 19:38:01 +0200
committerFourteenBrush <74827262+FourteenBrush@users.noreply.github.com>2025-07-11 19:38:01 +0200
commit64bb0d1c7d03d0ce3a1643401009c528ec9ac296 (patch)
tree78d7d4ee31101baffe13d95ec2c0eef352aa9f52 /src/check_builtin.cpp
parentcb05271157a944c934dd8bf015570f25ebd2eccc (diff)
Allocate temp array instead of sorting in place
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index 70848cec6..041e89afd 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -6941,8 +6941,8 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
return false;
}
- // sort enum fields in place in ascending order
- Array<Entity *> enum_constants = type->Enum.fields;
+ auto enum_constants = array_make<Entity *>(temporary_allocator(), type->Enum.fields.count);
+ array_copy(&enum_constants, type->Enum.fields, 0);
array_sort(enum_constants, enum_constant_entity_cmp);
BigInt minus_one = big_int_make_i64(-1);