Closed
Bug 1147355
Opened 11 years ago
Closed 11 years ago
useless initilization
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: zolk232, Unassigned)
Details
(Whiteboard: [lang=cpp])
Attachments
(1 file)
|
560 bytes,
patch
|
jwatt
:
review-
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0
Build ID: 20150321175551
Steps to reproduce:
automatic script found this issue
Actual results:
An initilization is useless.
Expected results:
The variable shouldn't be initilized.
Attachment #8583045 -
Flags: review?(gavin.sharp)
Updated•11 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•11 years ago
|
Component: Untriaged → SVG
Product: Firefox → Core
Comment 1•11 years ago
|
||
Comment on attachment 8583045 [details] [diff] [review]
patch.diff
This seems like not a particularly important "bug" to fix (initializing it doesn't really hurt and does potentially reduce risk of using an uninitialized variable).
Attachment #8583045 -
Flags: review?(gavin.sharp) → review?(jwatt)
Comment 2•11 years ago
|
||
Comment on attachment 8583045 [details] [diff] [review]
patch.diff
Hi zolk232. I'm reluctant to r- your first patch, but there are advantages to unnecessarily initializing variables. One issue is the cognitive load associated with a piece of code is important. For my part, whenever I'm skimming code and see an uninitialized variable it throws up a red flag. I then end up spending a few moments (or more) processing the logic in more detail to make sure that there isn't a dangerous bug there. I'm sure others do the same. There's also the hazard that someone changes the code and fails to notice that they've changed the logic in a way that now allows the variable to be used uninitialized under certain circumstances. I'd therefore prefer to leave this code as it is. The performance impact of initializing variables unnecessarily is usually essentially zero, or if the compiler optimizes away the initialization it is literally zero. I'd suggest that you configure the automatic script that you're using to ignore this class of issues so you can focus on the more serious issues it may find. Sorry about the r- in this instance, and thanks for raising the issue all the same.
Attachment #8583045 -
Flags: review?(jwatt) → review-
Comment 3•11 years ago
|
||
Sounds like this is WONTFIX, then.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•