Closed Bug 1147355 Opened 11 years ago Closed 11 years ago

useless initilization

Categories

(Core :: SVG, defect)

36 Branch
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: zolk232, Unassigned)

Details

(Whiteboard: [lang=cpp])

Attachments

(1 file)

Attached patch patch.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)
OS: Linux → All
Hardware: x86_64 → All
Whiteboard: [lang=cpp]
Component: Untriaged → SVG
Product: Firefox → Core
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 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-
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.

Attachment

General

Creator:
Created:
Updated:
Size: