Closed Bug 1622660 Opened 5 years ago Closed 4 years ago

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

Categories

(Developer Infrastructure :: Source Code Analysis, task)

task
Not set
minor

Tracking

(firefox79 fixed)

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: Sylvestre, Assigned: danny, 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.

    return;
  } else if (!aWillWait) {
    // Resource is not available and do not wait.
    // Send fail response
    mozilla::Unused << aParent->SendResponse(aId, false /* fail */);
    return;
  }

do not use 'else' after 'return'

https://searchfox.org/mozilla-central/source/dom/media/systemservices/MediaSystemResourceService.cpp#79-81

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 was able to setup Firefox environment on Windows. I finished build and run without errors, then I applied the required change to this bug.

How do I compile it so that it will only take my change? When I used ./mach build, it compiled from the start, which is quite long on my machine, about 38 minutes.

Also, how do I run the specific test for dom/media/systemservices? I read a specific doc online to use ./mach test dom/media/systemservices which is the path of the file I changed, but it cannot find the test for it.

Flags: needinfo?(sledru)

sorry, I missed your message.
38 minutes is normal on Windows!

For such changes, I would not worry about running tests. Just push it! :)

Flags: needinfo?(sledru)
Assignee: nobody → danny
Status: NEW → ASSIGNED

Well done!

Could you please request the patch to land? See the doc on how to do it

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

Well done!

Could you please request the patch to land? See the doc on how to do it

Yeah okay, I have added the "check-in-needed" tag now.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
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: