Move _.repeat empty string check to the left.

This commit is contained in:
John-David Dalton
2015-09-14 01:09:54 -07:00
parent 7f284d6ed5
commit bbc7b0b59b

View File

@@ -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.