1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Avoid copy-on-write when reading vectors

This commit is contained in:
mashumafi
2024-06-18 17:12:23 -04:00
committed by Lukas Tenbrink
parent 0793c626d2
commit b73346ef19
2 changed files with 4 additions and 3 deletions

View File

@@ -738,7 +738,7 @@ int Array::bsearch(const Variant &p_value, bool p_before) const {
Variant value = p_value;
ERR_FAIL_COND_V(!_p->typed.validate(value, "binary search"), -1);
SearchArray<Variant, _ArrayVariantSort> avs;
return avs.bisect(_p->array.ptrw(), _p->array.size(), value, p_before);
return avs.bisect(_p->array.ptr(), _p->array.size(), value, p_before);
}
int Array::bsearch_custom(const Variant &p_value, const Callable &p_callable, bool p_before) const {