[ADD/WIP] Remove boundscheck on array sorts
Some checks are pending
Compile Telodendria / Compile Telodendria (x86, alpine-v3.19) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86, debian-v12.4) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86, freebsd-v14.0) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86, netbsd-v9.3) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, alpine-v3.19) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, debian-v12.4) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, freebsd-v14.0) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, netbsd-v9.3) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, openbsd-v7.4) (push) Waiting to run

This commit is contained in:
lda 2024-05-18 17:11:29 +02:00
parent ecb18dc7b2
commit e1d632b135
3 changed files with 4 additions and 16 deletions

@ -1 +1 @@
Subproject commit 5d87da31cda74e6808eebca72e9475aabde86532
Subproject commit 346b912a0633cceac10780b8a103f6c89b5ba89f

View file

@ -118,10 +118,7 @@ CanonicalJsonEncode(HashMap * object, Stream * out)
ArrayAdd(keys, key);
}
if (ArraySize(keys) != 0)
{
ArraySort(keys, CanonicalJsonKeyCompare);
}
ArraySort(keys, CanonicalJsonKeyCompare);
/* The total number of bytes written */
length = 0;

View file

@ -142,13 +142,7 @@ StateResolveV1(Room * room, Array * states)
Free(type);
Free(key);
}
if (ArraySize(events) != 0)
{
/* TODO: Cytoplasm currently doesn't behave correctly
* when the array size is 0, I'll need to file a bug
* report/PR eventually. */
ArraySort(events, V1Cmp);
}
ArraySort(events, V1Cmp);
/* Add first event. */
first = ArrayDelete(events, 0);
StateSet(
@ -202,10 +196,7 @@ StateResolveV1(Room * room, Array * states)
while (StateIterate(conflicts, &type, &key, (void **) &conflicting))
{
if (ArraySize(conflicting) != 0)
{
ArraySort(conflicting, V1Cmp);
}
ArraySort(conflicting, V1Cmp);
for (j = ArraySize(conflicting) - 1; j >= 0; j--)
{
HashMap *event = ArrayGet(events, j);