Closed
Bug 1403660
Opened 7 years ago
Closed 7 years ago
Do not use 'else' after 'break' in /memory/build/rb.h
Categories
(Core :: Memory Allocator, defect)
Tracking
()
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: janx, Assigned: janx)
References
Details
Attachments
(1 file, 1 obsolete file)
1.46 KB,
patch
|
n.nethercote
:
review+
|
Details | Diff | Splinter Review |
While inspecting patches, our static analyzer found a readability issue in the 'rb_remove' macro in /memory/build/rb.h:
> In /memory/build/rb.h:
> @@ -622,14 +622,13 @@
> rbp_r_t); \
> } \
> break; \
> } else { \
> ^
> Warning: Do not use 'else' after 'break' [clang-tidy: readability-else-after-return]
This code could indeed be simplified by removing the unnecessary 'else'.
Assignee | ||
Comment 1•7 years ago
|
||
Please have a look. https://treeherder.mozilla.org/#/jobs?repo=try&revision=6eadf573483a
Attachment #8912825 -
Flags: review?(n.nethercote)
Assignee | ||
Comment 2•7 years ago
|
||
New try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1aa5b6aab773 (I cancelled the previous one, as it seems there was a race condition that included many other changesets in my push.)
Comment 3•7 years ago
|
||
glandium is completely changing this code over in bug 1403444, maybe ping him there?
Assignee | ||
Comment 4•7 years ago
|
||
Indeed, thanks! Glandium, feel free to take over this bug and steal my fix for the 'rb_remove' macro.
Flags: needinfo?(mh+mozilla)
Comment 5•7 years ago
|
||
Comment on attachment 8912825 [details] [diff] [review] Do not use 'else' after 'break' in /memory/build/rb.h. Review of attachment 8912825 [details] [diff] [review]: ----------------------------------------------------------------- The else is still there after bug 1403444, but please rebase on top of that bug.
Attachment #8912825 -
Flags: review?(n.nethercote)
Updated•7 years ago
|
Flags: needinfo?(mh+mozilla)
Assignee | ||
Comment 6•7 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #5) > The else is still there after bug 1403444, but please rebase on top of that > bug. I will, thanks!
Depends on: 1403444
Assignee | ||
Comment 7•7 years ago
|
||
Rebased on top of bug 1403444.
Attachment #8913230 -
Flags: review?(n.nethercote)
Assignee | ||
Updated•7 years ago
|
Attachment #8912825 -
Attachment is obsolete: true
Assignee | ||
Comment 8•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=1efb1af4d04fdce530006346466c29b29d33876e
Comment 9•7 years ago
|
||
Comment on attachment 8913230 [details] [diff] [review] Do not use 'else' after 'break' in /memory/build/rb.h. Review of attachment 8913230 [details] [diff] [review]: ----------------------------------------------------------------- This is harmless, but the Mozilla Coding Style (https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style) doesn't say anything about no-else-after-break, it only bans no-else-after-return. I can see that clang-tidy is lumping no-else-after-break into its "readability-else-after-return" check.
Attachment #8913230 -
Flags: review?(n.nethercote) → review+
Assignee | ||
Comment 10•7 years ago
|
||
Thanks!
> This is harmless, but the Mozilla Coding Style (https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style) doesn't say anything about no-else-after-break, it only bans no-else-after-return. I can see that clang-tidy is lumping no-else-after-break into its "readability-else-after-return" check.
Good catch. I've updated the MDN page to add "(or a `break`)" to clarify.
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Comment 11•7 years ago
|
||
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/c93d12aca502 Do not use 'else' after 'break' in /memory/build/rb.h. r=njn
Keywords: checkin-needed
Comment 12•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c93d12aca502
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•