Skip to content

PriorityQueue: use compareFn in update() #12154

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

Merged
merged 1 commit into from
Jul 22, 2022
Merged

Conversation

voroskoi
Copy link
Contributor

update() calls mem.indexOfScalar() which uses == for comparing items,
which fails when the operator is not supported.
As PirorityQueue needs a comparing function anyway we can use .eq results
to identify matching objects.

closes #9918

update() calls mem.indexOfScalar() which uses `==` for comparing items,
which fails when the operator is not supported.
As PirorityQueue needs a comparing function anyway we can use `.eq` results
to identify matching objects.

closes ziglang#9918
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std.PriorityQueue.update assumes T supports the equality operator
2 participants