aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-10-27 19:39:34 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-10-27 19:39:34 -0400
commitdf258c1773adef59994da2e010f74610eb81a1b2 (patch)
treeabd0e0c898ddb5702b854f1822f1fd3a4a4faa53
parent71d6787541e829781e17d90f6b57eabcb17fb8a9 (diff)
Remove an unnecessary ARRAY_COPY()
-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);