From bbc7b0b59b21ea4fb0f39c153ad2a2193c17486a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 14 Sep 2015 01:09:54 -0700 Subject: [PATCH] Move `_.repeat` empty string check to the left. --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 24474325f..bf29bae4b 100644 --- a/lodash.js +++ b/lodash.js @@ -10590,7 +10590,7 @@ var result = ''; string = baseToString(string); n = toInteger(n); - if (n < 1 || n == POSITIVE_INFINITY || n == NEGATIVE_INFINITY || !string) { + if (!string || n < 1 || n == POSITIVE_INFINITY || n == NEGATIVE_INFINITY) { return result; } // Leverage the exponentiation by squaring algorithm for a faster repeat.