mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 13:00:28 +00:00
Allocate temp array instead of sorting in place
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user