Skip to content

Expose Godot's native sort and binary search functions on VariantArray #989

Open
@chitoyuu

Description

@chitoyuu

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, or binary_search?

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: coreComponent: core (mod core_types, object, log, init, ...)featureAdds functionality to the library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions