Optimize _.pairs.

Former-commit-id: 1de87609a8635fb8d48bc558fbdabc545da53b4b
This commit is contained in:
John-David Dalton
2012-08-31 15:45:27 -07:00
parent 84d69fa2a1
commit 2c31411ffb
4 changed files with 29 additions and 4 deletions

View File

@@ -1865,7 +1865,7 @@
* @static
* @memberOf _
* @category Objects
* @param {Object} object The object to inspect..
* @param {Object} object The object to inspect.
* @returns {Array} Returns new array of key-value pairs.
* @example
*
@@ -1875,7 +1875,7 @@
var pairs = createIterator({
'args': 'object',
'init':'[]',
'inLoop': 'result.push([index, value])'
'inLoop': 'result' + (isKeysFast ? '[ownIndex] = ' : '.push') + '([index, value])'
});
/**