Skip to content
Permalink
Browse files
Use real declaration since that helps gzip: thanks @gibson042.
  • Loading branch information
jaubourg committed Apr 25, 2012
1 parent 245f5a2 commit 42dbc86573a1172157def6fc417f33b69d00c2a5
Showing 1 changed file with 5 additions and 3 deletions.
@@ -93,7 +93,8 @@ jQuery.Callbacks = function( options ) {
// First, we save the current length
var start = list.length;
(function add( args ) {
jQuery.each( args, function( type, arg ) {
jQuery.each( args, function( _, arg ) {
var type;
if ( ( type = jQuery.type(arg) ) === "array" ) {
// Inspect recursively
add( arg );
@@ -119,8 +120,9 @@ jQuery.Callbacks = function( options ) {
// Remove a callback from the list
remove: function() {
if ( list ) {
jQuery.each( arguments, function( _, arg, index ) {
while( ( index = jQuery.inArray( arg, list, index || 0 ) ) > -1 ) {
jQuery.each( arguments, function( _, arg ) {
var index = 0;
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 );
// Handle firing indexes
if ( firing ) {

4 comments on commit 42dbc86

@mikesherov
Copy link
Member

@mikesherov mikesherov commented on 42dbc86 Apr 25, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should always use real declarations. Using unused args as var declarations is hacky.

@jaubourg
Copy link
Member Author

@jaubourg jaubourg commented on 42dbc86 Apr 25, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\o/ I'm a hacker!

@mikesherov
Copy link
Member

@mikesherov mikesherov commented on 42dbc86 Apr 25, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I should qualify. I find it hacky. Others may disagree :)

@jaubourg
Copy link
Member Author

@jaubourg jaubourg commented on 42dbc86 Apr 25, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;P

Please sign in to comment.