Closed Bug 828000 Opened 12 years ago Closed 11 years ago

Paris bindings code generator can create an unneeded local `isNull'

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (v1) (obsolete) — Splinter Review
11:42.60 Warning: -Wunused-variable in /Users/ehsanakhgari/moz/mozilla-central/obj-ff-dbg/dom/bindings/URLBinding.cpp: unused variable 'isNull'
11:42.60 /Users/ehsanakhgari/moz/mozilla-central/obj-ff-dbg/dom/bindings/URLBinding.cpp:30:8: warning: unused variable 'isNull' [-Wunused-variable]
11:42.60   bool isNull = val.isNullOrUndefined();
11:42.60        ^
11:42.61 Warning: -Wunused-variable in /Users/ehsanakhgari/moz/mozilla-central/obj-ff-dbg/dom/bindings/URLBinding.cpp: unused variable 'isNull'
11:42.61 /Users/ehsanakhgari/moz/mozilla-central/obj-ff-dbg/dom/bindings/URLBinding.cpp:59:8: warning: unused variable 'isNull' [-Wunused-variable]
11:42.61   bool isNull = val.isNullOrUndefined();
11:42.61        ^
Attachment #699400 - Flags: review?(bzbarsky)
Assignee: nobody → ehsan
Comment on attachment 699400 [details] [diff] [review]
Patch (v1)

Hmm.  This has the drawback of testing val for null-or-undefined. for every dictionary member, when val is not changing...

How about we make that initial isNull line just conditional on len(memberInits) != 0?
Attachment #699400 - Flags: review?(bzbarsky)
Attached patch Patch (v2)Splinter Review
Like this?
Attachment #699400 - Attachment is obsolete: true
Attachment #699464 - Flags: review?(bzbarsky)
Comment on attachment 699464 [details] [diff] [review]
Patch (v2)

Yes, like that.  ;)
Attachment #699464 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/51e548cbe18f
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: