Skip to content

Commit

Permalink
perf: dont expand shared arrays too often
Browse files Browse the repository at this point in the history
  • Loading branch information
hargoniX committed Dec 29, 2024
1 parent 844e82e commit 6790707
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@ extern "C" LEAN_EXPORT object * lean_array_push(obj_arg a, obj_arg v) {
else
r = lean_copy_expand_array(a, true);
} else {
r = lean_copy_expand_array(a, lean_array_capacity(a) < 2*lean_array_size(a) + 1);
r = lean_copy_expand_array(a, lean_array_capacity(a) < lean_array_size(a) + 1);
}
lean_assert(lean_array_capacity(r) > lean_array_size(r));
size_t & sz = lean_to_array(r)->m_size;
Expand Down

0 comments on commit 6790707

Please sign in to comment.