From e5e24bd33f348f89bedc76b2b650a2b4c5a0a024 Mon Sep 17 00:00:00 2001 From: Ariel Flesler Date: Tue, 6 May 2008 14:54:53 +0000 Subject: [PATCH] jquery core: enhancements to jquery.map, closes #2803 --- src/core.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/core.js b/src/core.js index 6b497fdc..c9076b68 100644 --- a/src/core.js +++ b/src/core.js @@ -1194,15 +1194,11 @@ jQuery.extend({ for ( var i = 0, length = elems.length; i < length; i++ ) { var value = callback( elems[ i ], i ); - if ( value !== null && value != undefined ) { - if ( value.constructor != Array ) - value = [ value ]; - - ret = ret.concat( value ); - } + if ( value != null ) + ret[ ret.length ] = value; } - return ret; + return ret.concat.apply( [], ret ); } });