-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Quickhull - reduce warning spam and make hideable #51469
Conversation
ERR_CONTINUE(!F2); | ||
|
||
if (unlikely(!F2)) { | ||
warning_not_f2 = true; |
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.
Could you use WARN_PRINT_ONCE()
here instead of using booleans to defer it?
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 can easily change these to WARN_PRINT_ONCE
s within the if statements.
This is just me, my reflex action is to write less branches 😁 . But in this case readability is probably the most important factor.
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.
Ah no on second thoughts, it would involve 3 if statements because of the _flag_warnings
parameter. So it may be better how it currently is, otherwise the logic in the hot loop could become harder to follow in terms of readability...
I.e. it would end up being:
if (unlikely(!F2))
{
if (_flag_warnings)
{
WARN_PRINT_ONCE etc
}
continue;
}
I don't know which is preferred. I'd still slightly come out with the WARN_PRINTs separate as slightly better, but either is fine, I can change it, just let me know.
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.
All that logic is quite awkward IMO.
Errors and warnings should point at things that are either:
- Engine bugs that we need to fix.
- User mistakes where they pass invalid input.
If it's neither of those and those are benign cases which are not meant to call the user's attention, they should just be replaced by silent continue
. If they are signs that the user or the engine is using bogus data, that's something we should fix.
Not sure what the CI failure is about. Has something been merged that hasn't updated the docs? |
Something was merged that had updated the docs properly, but we since changed the docs formatting :D |
Fixed. |
Added one more warning to the hideable warnings. These seem to be benign warnings and are hidden during use in rooms and portals. When used from other areas, only one warning is displayed per run, instead of for every occurrence.
c8faf14
to
fc60eac
Compare
Thanks! |
Added one more warning to the hideable warnings. These seem to be benign warnings and are hidden during use in rooms and portals. When used from other areas, only one warning is displayed per run, instead of for every occurrence.
Fixes warning reported by @timothyqiu
Notes