Closed Bug 851986 Opened 11 years ago Closed 11 years ago

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

Categories

(Core :: Web Audio, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

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

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: 11 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.

Attachment

General

Created:
Updated:
Size: