…n to fireWith is copied internally.
- Loading branch information
There are no files selected for viewing
3 comments
on commit 97210d4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may get chided for replacing all that inline code with function calls... Callbacks is one of those modules where performance might trump everything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most critical parts (initial object creation and executing callback) are untouched (if you except the initial cost of creating the options cache the first time a string is encountered).
I don't even know what got into my mind when I decided not to use any of the jQuery built-in array and iteration methods: having the duplicate code like this all over the place is asking for trouble. Beside, this has good consequences, for instance Callbacks.add accepting array-like objects and inspecting them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this method public-facing? The signature is much easier to optimize, but not as transparent.