From 1afcfa440666bf24277f431523b5b6c2daeeafad Mon Sep 17 00:00:00 2001 From: jdalton Date: Mon, 4 May 2015 21:53:12 -0700 Subject: [PATCH] Use precomputed values for `MAX_ARRAY_LENGTH` and `MAX_SAFE_INTEGER`. --- lodash.src.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 1a1ba0716..8e235d437 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -835,7 +835,7 @@ POSITIVE_INFINITY = Number.POSITIVE_INFINITY; /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1, + var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; @@ -846,7 +846,7 @@ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) * of an array-like value. */ - var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; + var MAX_SAFE_INTEGER = 9007199254740991; /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap;