-
Notifications
You must be signed in to change notification settings - Fork 15
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
array
and array_ref
operator==
and operator!=
don't short circuit
#4
Comments
Oof, I just ran into this. Not only do they not short circuit, they compare all elements, which can be slow and surprising without looking at the code. I expected built-in operations on |
@fbleibel-g Would this break a lot of Google users? |
@jiawen it sounds like you expect this to be a shallow equality? This issue is about a much more subtle issue: when doing a deep equality check, we don't short circuit upon finding a falsifying element. Re: deep vs. shallow equality: I made Maybe it's reasonable to make |
Oops. It was nearby but that TODO in the code didn't actually refer here. Re: Notably, absl::Span talks about how unlike To not break existing users, maybe add |
I agree we should probably remove Maybe we just don't need to provide a helper for this? If it's just I think we should try just removing it. I don't think the usage of this library is big enough to worry about maintaining compatibility for such a likely obscure use case. We already have |
Removing it SGTM. I can handle the Google side upgrade easily enough. |
Great. I'll put up a PR. There's no rush on this. |
These operators could return as soon as falsifying elements are found.
The text was updated successfully, but these errors were encountered: