-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
src: fix useless call in permission.cc #46833
src: fix useless call in permission.cc #46833
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the current state here isn't ideal, but I'd rather fix it by doing proper error handling (i.e. return;
on empty Maybe
) than using .Check()
and adding potential crashes here
@addaleax I went with |
@tniessen I think in ideal world we'd also handle errors from the string creation functions, but since they can only fail (afaik) if the strings exceed the maximum length of strings allowed by V8, and they (currently) only accept input that is already defined at compile time, so I don't have strong feelings about those (The extra |
@addaleax Thank you, that makes sense. I'll update it soon. |
FromMaybe() has no side effects and the return value is ignored. Instead, if Set() fails, then another exception is pending, so return early.
5989869
to
0e95c5a
Compare
Landed in 3abbc38 |
FromMaybe() has no side effects and the return value is ignored. Instead, if Set() fails, then another exception is pending, so return early. PR-URL: #46833 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
FromMaybe()
has no side effects and the return value is ignored. UseCheck()
instead to ensure that the operation succeeded.