Skip to content

Commit b3663c2

Browse files
author
Gonzalo Diaz
committed
[BUGFIX] SonarQube: Prefer Math.max() to simplify ternary expressions.
Ternary expressions should be replaced with "Math.min()" or "Math.max()" for simple comparisons javascript:S7766
1 parent 8cfa546 commit b3663c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/projecteuler/problem0018.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function problem0018(_triangle) {
2727
console.debug('leafs count', leafs.length, 'leafs', leafs);
2828

2929
const __START_FROM__ = 0;
30-
const max = leafs.reduce((a, b) => (a > b ? a : b), __START_FROM__);
30+
const max = leafs.reduce((a, b) => Math.max(a, b), __START_FROM__);
3131

3232
return max;
3333
}

0 commit comments

Comments
 (0)