slices: BinarySearch, BinarySearchFunc: document return value for multiple possible matches in slice #65446
Labels
Documentation
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Proposal Details
Currently the documentation of
slices.BinarySearch
says:To me, it is not clear what is returned if the
target
exists multiple times inx
. It seems (looking at the implementation) it always returns the index of first appearance, which would be logical, and a good feature, but I cannot 100% infer this from the documentation.Issued this as a issue as for now I have to assume that it can return any index of an element with target value, as I don't know if the current behaviour is incidental or guaranteed.
The text was updated successfully, but these errors were encountered: