Closed Bug 851986 Opened 7 years ago Closed 7 years ago

Avoid calling a virtual function when getting the source for an AudioNodeStream

Categories

(Core :: Web Audio, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: ehsan, Assigned: ehsan)

References

Details

Attachments

(1 file)

Attached patch Patch (v1)Splinter Review
This is a micro optimization, but I did see this virtual call come up in one of my profiles, and it's not like that we're getting any runtime checks out of it in non-debug builds anyways.
Attachment #725959 - Flags: review?(roc)
Comment on attachment 725959 [details] [diff] [review]
Patch (v1)

Review of attachment 725959 [details] [diff] [review]:
-----------------------------------------------------------------

I would just do
 AudioNodeStream* a = static_cast<AudioNodeStream*>(s);
 NS_ASSERTION(a == s->AsAudioNodeStream());
Attachment #725959 - Flags: review?(roc) → review+
Yeah, that's better:

https://hg.mozilla.org/integration/mozilla-inbound/rev/60ab8fd2676b
Assignee: nobody → ehsan
https://hg.mozilla.org/mozilla-central/rev/60ab8fd2676b
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Mass moving Web Audio bugs to the Web Audio component.  Filter on duckityduck.
Component: Video/Audio → Web Audio
You need to log in before you can comment on or make changes to this bug.