Closed Bug 1622658 Opened 5 years ago Closed 3 years ago

the 'empty' method should be used to check for emptiness instead of 'size'

Categories

(Developer Infrastructure :: Source Code Analysis, task, P5)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Sylvestre, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 obsolete file)

Filling as a good first bug to learn workflows.

if (aHistogram.size() == 0) {
should use .empty() instead

https://searchfox.org/mozilla-central/source/gfx/layers/composite/FPSCounter.cpp#279

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-container-size-empty.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.

Mentor: sledru
Keywords: good-first-bug
Whiteboard: [lang=C++]

Since the bug (use of the size() method instead of the more appropriate empty() one to check whether the aHistogram container is empty) was alread fixed in the meantime, I rechanged the code to its previous state (aHistogram.size() == 0).
Hence, please reject this patch and I will then re-submit the file with the correct snippet (aHistogram.empty()). Had I not corrected the file in some way, Watchman would have not identified any change to the source code and I would have been able to test the workflow. Thanks.

Assignee: nobody → xamurbach
Status: NEW → ASSIGNED
Attachment #9156666 - Attachment is obsolete: true

This good-first-bug hasn't had any activity for 6 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: xamurbach → nobody
Status: ASSIGNED → NEW
Priority: -- → P5

I wanted to work on this bug, but It's already fixed in my source code

Indeed, thanks

I have other bugs like this one. Would you like me to create one?

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

Indeed, thanks

I have other bugs like this one. Would you like me to create one?

yes please, thank you :)

Since you have other bugs like this one, may I also work on a bug?

Flags: needinfo?(sledru)

Andi can open new bugs for you folks :)

Flags: needinfo?(sledru) → needinfo?(bpostelnicu)

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

Andi can open new bugs for you folks :)

Awesome!

Can I take this up ? How to contribute to this bug ?

Flags: needinfo?(sledru)

Andi will create a few bugs for you folks :)

Flags: needinfo?(sledru)

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

Indeed, thanks

I have other bugs like this one. Would you like me to create one?

Please do create. Its really great for new comers to understand stuff.
Thank You.

I reported about 10 new bugs. See the new bugs referenced in bug 712350

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(bpostelnicu)
Resolution: --- → FIXED
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: