Closed Bug 1737096 Opened 3 years ago Closed 3 years ago

readstrings.cpp: the 'empty' method should be used to check for emptiness instead of 'size'

Categories

(Developer Infrastructure :: Source Code Analysis, task)

Tracking

(firefox96 fixed)

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: Sylvestre, Assigned: tawahpeggy98, Mentored)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file, 3 obsolete files)

Filling as a good first bug to learn workflows.

if (mKeys.size() < 1) {
should use .empty() instead

https://searchfox.org/mozilla-central/rev/489e82dcc1e5afbe691ff3b1c982382914637e38/toolkit/mozapps/update/common/readstrings.cpp#340

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.

No longer depends on: 1737093

readstring.cpp:the empty method should be used to check for emptiness instead of the size method.

Assignee: nobody → tawahpeggy98
Status: NEW → ASSIGNED

Hello Sylvestre,
please I would appreciate if you can help me review this.
thanks,
Peggy

Peggy, you already have feedback by bytesized. See:
https://phabricator.services.mozilla.com/D129718#4215456

okay, thank you very much Sylvestre

readstrings.cpp:the empty method should be used to check for emptiness instead of the size method.

Depends on D129751

readstrings.cpp:the empty method shoud be used to check for emptiness instead of the size method.

readstrings.cpp:the empty method should be used to check for emptiness instead of the size method.

Could you please close (abandon) the old reviews ?

Attachment #9248527 - Attachment is obsolete: true
Attachment #9248103 - Attachment is obsolete: true
Attachment #9248599 - Attachment is obsolete: true

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

Could you please close (abandon) the old reviews ?

I have done so

Attachment #9248601 - Attachment description: Bug 1737096 - change size() to empty().r?Sylvestre Ledru. → Bug 1737096 - change size() to empty().r?Sylvestre
Attachment #9248601 - Attachment description: Bug 1737096 - change size() to empty().r?Sylvestre → Bug 1737096 - change size() to empty() r?Sylvestre
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/09a7fdf173b4 change size() to empty() r=application-update-reviewers,bytesized
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
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: