From db9a7e210efd2377d24ab8852fb7b7f4f8fadaec Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Sun, 18 Jun 2017 21:17:05 +0200 Subject: [PATCH] Shortened variables. --- src/scripts/hints.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/scripts/hints.js b/src/scripts/hints.js index 31098b3..c45ad06 100644 --- a/src/scripts/hints.js +++ b/src/scripts/hints.js @@ -227,25 +227,21 @@ var hints = Object.freeze((function(){ helper(window); } - function getMaxHintsSameLength(hintStringLength) { - if(hintStringLength <= 0) { + function getMaxHintsSameLength(len) { + if (len <= 0) { return 0; } - return config.hintKeys.length ** hintStringLength; + return config.hintKeys.length ** len; } - function getMaxHints(hintStringMaxLength) { + function getMaxHints(maxlen) { var res = 0, - hintStringLength = hintStringMaxLength; + len = maxlen; - if(hintStringMaxLength <= 0) { - return 0; - } - - while(hintStringLength > 0) { - res += getMaxHintsSameLength(hintStringLength); - hintStringLength--; + while (len > 0) { + res += getMaxHintsSameLength(len); + len--; } return res; -- 2.20.1