mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 00:46:07 +00:00
fix reverse on custom sort
This commit is contained in:
@@ -364,6 +364,11 @@ func ArArray(arr []any) ArObject {
|
||||
if err.EXISTS {
|
||||
return nil, err
|
||||
}
|
||||
if reverse {
|
||||
for i, j := 0, len(output)-1; i < j; i, j = i+1, j-1 {
|
||||
output[i], output[j] = output[j], output[i]
|
||||
}
|
||||
}
|
||||
arr = output
|
||||
val.obj["length"] = newNumber().SetUint64(uint64(len(arr)))
|
||||
val.obj["__value__"] = arr
|
||||
|
||||
Reference in New Issue
Block a user