From 1773557a888a061b7554c4c3e6d34bfd7a804cc3 Mon Sep 17 00:00:00 2001 From: gumi Date: Sun, 22 Apr 2018 13:17:12 -0400 Subject: we don't need strcmp for string < string --- npc/functions/array.txt | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/npc/functions/array.txt b/npc/functions/array.txt index 1feef266..6093aa32 100644 --- a/npc/functions/array.txt +++ b/npc/functions/array.txt @@ -424,17 +424,9 @@ S_Partition: .@i = getarg(1) - 1; freeloop(true); - if (isstr(getarg(0))) { - for (.@j = getarg(1); .@j <= getarg(2) - 1; ++.@j) { - if (strcmp(getelementofarray(getarg(0), .@j), getelementofarray(getarg(0), getarg(2))) < 0) { - swap(getelementofarray(getarg(0), ++.@i), getelementofarray(getarg(0), .@j)); - } - } - } else { - for (.@j = getarg(1); .@j <= getarg(2) - 1; ++.@j) { - if (getelementofarray(getarg(0), .@j) < getelementofarray(getarg(0), getarg(2))) { - swap(getelementofarray(getarg(0), ++.@i), getelementofarray(getarg(0), .@j)); - } + for (.@j = getarg(1); .@j <= getarg(2) - 1; ++.@j) { + if (getelementofarray(getarg(0), .@j) < getelementofarray(getarg(0), getarg(2))) { + swap(getelementofarray(getarg(0), ++.@i), getelementofarray(getarg(0), .@j)); } } freeloop(false); -- cgit v1.2.3-70-g09d2