summaryrefslogtreecommitdiff
path: root/npc/functions/array.txt
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-04-22 13:17:12 -0400
committergumi <git@gumi.ca>2018-04-22 13:17:12 -0400
commit1773557a888a061b7554c4c3e6d34bfd7a804cc3 (patch)
tree0528786266be3969641f9e86fadec16de0e97bf6 /npc/functions/array.txt
parent6c31865241d01c3e960c84ed1949477d140b892a (diff)
downloadserverdata-1773557a888a061b7554c4c3e6d34bfd7a804cc3.tar.gz
serverdata-1773557a888a061b7554c4c3e6d34bfd7a804cc3.tar.bz2
serverdata-1773557a888a061b7554c4c3e6d34bfd7a804cc3.tar.xz
serverdata-1773557a888a061b7554c4c3e6d34bfd7a804cc3.zip
we don't need strcmp for string < string
Diffstat (limited to 'npc/functions/array.txt')
-rw-r--r--npc/functions/array.txt14
1 files 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);