From: Daniel Carl Date: Sun, 18 Jun 2017 19:17:05 +0000 (+0200) Subject: Shortened variables. X-Git-Url: https://git.owens.tech/assets/favicon.png/assets/favicon.png/git?a=commitdiff_plain;h=db9a7e210efd2377d24ab8852fb7b7f4f8fadaec;p=vimb.git Shortened variables. --- 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;