diff --git a/src/base/BaseUtils.ts b/src/base/BaseUtils.ts index 0632b5c..8918de4 100644 --- a/src/base/BaseUtils.ts +++ b/src/base/BaseUtils.ts @@ -116,7 +116,7 @@ export class BaseUtils { * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random * See: https://stackoverflow.com/a/1527820/2549748 */ - public static getRandomInt(min, max) { + private static getRandomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; @@ -137,13 +137,13 @@ export class BaseUtils { while (integers.length !== n) { // skipped if n = max+1 --> all integers between 0 and max - integers.splice(getRandomInt(0, integers.length), 1); // definetly one hit per iteration + integers.splice(BaseUtils.getRandomInt(0, integers.length), 1); // definetly one hit per iteration } return integers; } const integers = []; while (integers.length < n) { - const integer = getRandomInt(0, max); + const integer = BaseUtils.getRandomInt(0, max); if (integers.indexOf(integer) === -1) { // not every iteration might add an element integers.push(integer);