repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Apply dependencies update
[poolifier.git]
/
benchmarks
/
benchmarks-utils.js
diff --git
a/benchmarks/benchmarks-utils.js
b/benchmarks/benchmarks-utils.js
index 0a964d7b60e0cfbca7caa3cdd3650b5af7e27bbc..c04162e1a617d704708b56496040640947e22171 100644
(file)
--- a/
benchmarks/benchmarks-utils.js
+++ b/
benchmarks/benchmarks-utils.js
@@
-31,14
+31,11
@@
function jsonIntegerSerialization (n) {
}
function generateRandomInteger (max = Number.MAX_SAFE_INTEGER, min = 0) {
}
function generateRandomInteger (max = Number.MAX_SAFE_INTEGER, min = 0) {
- if (max < 0) {
+ if (max <
min || max < 0 || min <
0) {
throw new RangeError('Invalid interval')
}
max = Math.floor(max)
if (min != null && min !== 0) {
throw new RangeError('Invalid interval')
}
max = Math.floor(max)
if (min != null && min !== 0) {
- if (max < min || min < 0) {
- throw new RangeError('Invalid interval')
- }
min = Math.ceil(min)
return Math.floor(Math.random() * (max - min + 1)) + min
}
min = Math.ceil(min)
return Math.floor(Math.random() * (max - min + 1)) + min
}