mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Remove unused index var and prevent leaking keyIndex var.
This commit is contained in:
13
lodash.js
13
lodash.js
@@ -1509,8 +1509,7 @@
|
|||||||
* @returns {Object} Returns `object`.
|
* @returns {Object} Returns `object`.
|
||||||
*/
|
*/
|
||||||
function baseForRight(object, callback, keysFunc) {
|
function baseForRight(object, callback, keysFunc) {
|
||||||
var index = -1,
|
var props = keysFunc(object),
|
||||||
props = keysFunc(object),
|
|
||||||
length = props.length;
|
length = props.length;
|
||||||
|
|
||||||
while (length--) {
|
while (length--) {
|
||||||
@@ -2245,7 +2244,8 @@
|
|||||||
* @returns {Array} Returns the array of property names.
|
* @returns {Array} Returns the array of property names.
|
||||||
*/
|
*/
|
||||||
function shimKeys(object) {
|
function shimKeys(object) {
|
||||||
var index = -1,
|
var keyIndex,
|
||||||
|
index = -1,
|
||||||
props = keysIn(object),
|
props = keysIn(object),
|
||||||
length = props.length,
|
length = props.length,
|
||||||
objLength = length && object.length,
|
objLength = length && object.length,
|
||||||
@@ -6544,14 +6544,13 @@
|
|||||||
if (!isObject(object)) {
|
if (!isObject(object)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
var keyIndex,
|
var length = object.length;
|
||||||
length = object.length;
|
|
||||||
|
|
||||||
length = (typeof length == 'number' && length > 0 &&
|
length = (typeof length == 'number' && length > 0 &&
|
||||||
(isArray(object) || (support.nonEnumStrings && isString(object)) ||
|
(isArray(object) || (support.nonEnumStrings && isString(object)) ||
|
||||||
(support.nonEnumArgs && isArguments(object))) && length) >>> 0;
|
(support.nonEnumArgs && isArguments(object))) && length) >>> 0;
|
||||||
|
|
||||||
var index = -1,
|
var keyIndex,
|
||||||
|
index = -1,
|
||||||
maxIndex = length - 1,
|
maxIndex = length - 1,
|
||||||
result = Array(length),
|
result = Array(length),
|
||||||
skipIndexes = length > 0,
|
skipIndexes = length > 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user