Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insorted behaves differently than in #48388

Closed
LilithHafner opened this issue Jan 23, 2023 · 1 comment
Closed

insorted behaves differently than in #48388

LilithHafner opened this issue Jan 23, 2023 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior duplicate Indicates similar issues or pull requests search & find The find* family of functions sorting Put things in order

Comments

@LilithHafner
Copy link
Member

julia> insorted(-2, [1,2,3], by=abs)
true

julia> in(-2, [1,2,3])
false

insorted is documented to return true iff x is == to an element of the collection. It actually returns true if x is neither less than nor greater than an element of the collection. We could

  1. add an == check that fixes this bug with a runtime penalty
  2. document the current behavior as expected
@LilithHafner LilithHafner added bug Indicates an unexpected problem or unintended behavior search & find The find* family of functions sorting Put things in order labels Jan 23, 2023
@LilithHafner
Copy link
Member Author

Duplicate of #44102

@LilithHafner LilithHafner marked this as a duplicate of #44102 Jan 23, 2023
@LilithHafner LilithHafner added the duplicate Indicates similar issues or pull requests label Jan 23, 2023
@LilithHafner LilithHafner closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior duplicate Indicates similar issues or pull requests search & find The find* family of functions sorting Put things in order
Projects
None yet
Development

No branches or pull requests

1 participant