Closed
Bug 1334797
Opened 8 years ago
Closed 8 years ago
AudioConduit.cpp: do not use 'compare' to test equality of strings; use the string equality operator instead
Categories
(Core :: WebRTC: Signaling, defect)
Core
WebRTC: Signaling
Tracking
()
RESOLVED
INVALID
Tracking | Status | |
---|---|---|
firefox54 | --- | affected |
People
(Reporter: Sylvestre, Unassigned, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [lang=C++])
This is a very easy good first bug for a beginner.
We should use "==" instead of compare here:
https://dxr.mozilla.org/mozilla-central/source/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp?q=AudioConduit.cpp&redirect_type=direct#1058
more info: http://clang.llvm.org/extra/clang-tidy/checks/misc-string-compare.html
Comment 1•8 years ago
|
||
This code appears to function correctly (it is comparing against 0, as required), so this is to some extent a matter of taste. It appears that the Mozilla style guide is silent on this topic.
sylvestre: you should probably start by proposing an adjustment to the C++ style guide. Absent that, this seems like it probably should be closed as INVALID.
Flags: needinfo?(sledru)
Reporter | ||
Comment 2•8 years ago
|
||
Sure, I will discuss with bsmedberg to update the C++ guide.
FWIW, we have 4 occurrences of this pattern. 3 are in unit tests (media/mtransport/test_nr_socket.cpp l144, 146 and 148), the last is this one.
Comment 3•8 years ago
|
||
I do want to make clear that I don't think that this is actually something the C++ style guide should really opine on, which suggests that this change also shouldn't be made without disussion
Reporter | ||
Comment 4•8 years ago
|
||
Just like in bug 1334265, this is just a source of good first bug :)
Invalid is fine by me. I have plenty of material others.
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•