-
Notifications
You must be signed in to change notification settings - Fork 296
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
Shouldn't this public function check for null? #292
Comments
I don't think so. Could you explain why you think it should check for null? The (undocumented, but hopefully apparent) precondition is |
I only asked cause it looks like a public facing API, I'm used to checking those for erroneous/malicious user input. |
This is a pretty common pattern in C++, in general you don't want to pay the cost for bounds checking. We have the new iteration API that prevents this is in the common case anyways. If we did bounds check then we have the question of what we would return when it fails. We don't use exceptions so we'd have to return a std::optional or absl::StatusOr probably, which would be a breaking change. |
closing then, ty |
Shouldn't this public function check for null?
s2geometry/src/s2/s2lax_loop_shape.h
Line 76 in ad5ef6c
context:
s2geometry/src/s2/s2lax_loop_shape.h
Line 96 in ad5ef6c
The text was updated successfully, but these errors were encountered: