Closed Bug 1622662 Opened 4 years ago Closed 4 years ago

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

Categories

(Developer Infrastructure :: Source Code Analysis, task)

task
Not set
minor

Tracking

(firefox80 fixed)

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: Sylvestre, Assigned: shindea422, Mentored)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file, 1 obsolete file)

Filling as a good first bug to learn workflows.


      if (ASCII_IS_SPACE(c)) {
        return kWbClassSpace;
      } else if (ASCII_IS_ALPHA(c) || ASCII_IS_DIGIT(c) ||
                 (c == '_' && !sStopAtUnderscore)) {

do not use 'else' after 'return'

https://searchfox.org/mozilla-central/source/intl/lwbrk/WordBreaker.cpp#56
And the following occurences

As the change is trivial, it is just 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.

I can do this

Here is the patch I created. Can you have a look please? Thanks!

Assignee: nobody → amogh532516
Status: NEW → ASSIGNED

I have created patch for this bug, please check it at https://phabricator.services.mozilla.com/D67739

(In reply to tash from comment #2)

Here is the patch I created. Can you have a look please? Thanks!

Sorry but we don't use github for contribution.
amogh started working on it but there are other similar good first bug. You can send me an email if you don't find one.

(In reply to Sylvestre Ledru [:Sylvestre] from comment #5)

(In reply to tash from comment #2)

Here is the patch I created. Can you have a look please? Thanks!

Sorry but we don't use github for contribution.
amogh started working on it but there are other similar good first bug. You can send me an email if you don't find one.

OK, will be sure to commit to phabricator for my next contribution!

Attachment #9134891 - Attachment is obsolete: true
Assignee: amogh532516 → nobody
Status: ASSIGNED → NEW

Can I contribute to it currently?

Sure :)

Can I contribute to this?
I am new to contributing to open source.

sure, please just submit a patch, it will be assigned!

alright!

This my first contribution.
As said in llvm coding standard else should not be used after interrupts statements.
It is good to solve more bug.

Assignee: nobody → shindea422
Status: NEW → ASSIGNED
Attachment #9162209 - Attachment description: Bug 1622662 - removed else which is not used. r=Sylvestre → Bug 1622662 - Remove the } else { after a return to simplify code. r=Sylvestre
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e0a680bfd926
Remove the } else { after a return to simplify code. r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: