aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 3f8a8d3a..c88e2a7f 100644
--- a/compile.c
+++ b/compile.c
@@ -2671,7 +2671,8 @@ CORD compile(env_t *env, ast_t *ast)
} else if (streq(call->name, "sort") || streq(call->name, "sorted")) {
CORD self = streq(call->name, "sort")
? compile_to_pointer_depth(env, call->self, 1, false)
- : compile_to_pointer_depth(env, call->self, 0, call->args != NULL);
+ // No need to do an ARRAY_COPY() here because it happens inside Array$sorted():
+ : compile_to_pointer_depth(env, call->self, 0, false);
CORD comparison;
if (call->args) {
type_t *item_ptr = Type(PointerType, .pointed=item_t, .is_stack=true);