Closed Bug 1626761 Opened 2 years ago Closed 1 year ago

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

Categories

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

task
Not set
minor

Tracking

(firefox79 fixed)

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: Sylvestre, Assigned: bharath.bmsce, Mentored)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

Filling as a good first bug to learn workflows.

      // XXX do we really want to convert numerals when copying text?
      if (aPrevCharArabic) {
        if (aNumFlag == IBMBIDI_NUMERAL_PERSIANCONTEXT)
          return NUM_TO_PERSIAN(aChar);
        else
          return NUM_TO_HINDI(aChar);
      } else
        return NUM_TO_ARABIC(aChar);

do not use 'else' after 'return'

https://searchfox.org/mozilla-central/source/intl/unicharutil/util/nsBidiUtils.cpp#57-63

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.

Assignee: nobody → bharath.bmsce
Status: NEW → ASSIGNED
Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/02618db5d8ca
Fixing readability-else-after-return bug, found by clang-tidy. r=jfkthame
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.