Closed Bug 1626765 Opened 3 months ago Closed 3 months ago

nsWindow.cpp: do not use 'else' after 'return'

Categories

(Firefox Build System :: Source Code Analysis, task)

task
Not set
minor

Tracking

(firefox77 fixed)

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: Sylvestre, Assigned: nikopacheco22, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [lang=C++])

Attachments

(1 file, 2 obsolete files)

+++ This bug was initially created as a clone of Bug #1626762 +++

+++ This bug was initially created as a clone of Bug #1626761 +++

Filling as a good first bug to learn workflows.

 if (parentWidget) {
          return DesktopToLayoutDeviceScale(
              parentWidget->RoundsWidgetCoordinatesTo());
        } else {
          NS_WARNING("Widget has no parent");
        }

do not use 'else' after 'return'

https://searchfox.org/mozilla-central/source/widget/gtk/nsWindow.cpp#806

As the change is pretty easy, it is mostly to learn how to contribute to Firefox.

Found by http://clang.llvm.org/extra/clang-tidy/checks/readability-else-after-return.html

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/tools/docs/contribute/how_to_contribute_firefox.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

Depends on D70144

Assignee: nobody → nikopacheco22
Status: NEW → ASSIGNED

Depends on D70145

Depends on D70145

Attachment #9139190 - Attachment is obsolete: true
Attachment #9139074 - Attachment is obsolete: true

Sorry! I had some issues with hg commit --amend, because I made many changes. I should use hg histedit instead. I think I did it correctly now.
Thanks for you help.

Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bbdf5e1478a9
delete 'else' after 'return'. r=sylvestre
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.