You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following methods of VariantArray are not exposed to Rust:
sort_custom
bsearch
bsearch_custom
These methods may have some fringe uses, such as for replicating GDScript behavior exactly, but are clumsy to use and generally slower (due to FFI overhead) than collecting the values to Vec and performing the corresponding operations purely on the Rust side.
Bindings for these methods can be added for completeness's sake, but it should be made clear in the documentation what the performance implications are.
Unresolved questions
Should bsearch be included under its original Godot name, or binary_search?
The text was updated successfully, but these errors were encountered:
Since we have a default parameter, we might add an overload bsearch_after. Regarding naming, before=false (i.e. not the default) because "the returned index comes after all existing entries of the value in the array".
Or even better, we just provide one method always taking before parameter -- as you say, it's obscure enough to be rarely used.
Also maybe worth documenting (assert might be too much):
Calling bsearch on an unsorted array results in unexpected behavior.
Created during survey of commented code (#377).
The following methods of
VariantArray
are not exposed to Rust:sort_custom
bsearch
bsearch_custom
These methods may have some fringe uses, such as for replicating GDScript behavior exactly, but are clumsy to use and generally slower (due to FFI overhead) than collecting the values to
Vec
and performing the corresponding operations purely on the Rust side.Bindings for these methods can be added for completeness's sake, but it should be made clear in the documentation what the performance implications are.
Unresolved questions
Should
bsearch
be included under its original Godot name, orbinary_search
?The text was updated successfully, but these errors were encountered: