Skip to content

Commit

Permalink
[BUGFIX] sonarcloud typescript:S6582 fixed.
Browse files Browse the repository at this point in the history
Prefer using an optional chain expression instead, as it's more concise and easier to read.
  • Loading branch information
Gonzalo Diaz committed May 9, 2024
1 parent b1dc6c1 commit c2598b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/projecteuler/lib/BNodeBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class BNodeBuilder<T = number> extends BNode<T> {
if (dataTree[i]?.[j]) {
const resultNode = new BNode<number>(dataTree[i][j] + (rootValue ?? 0));

if (dataTree[i + 1] && dataTree[i + 1][j] && dataTree[i + 1][j + 1]) {
if (dataTree?.[i + 1]?.[j] && dataTree?.[i + 1]?.[j + 1]) {
// Next left coordinates: [i + 1][j]
resultNode.setLeft(
BNodeBuilder.buildBNodeTreeWeight(
Expand Down

0 comments on commit c2598b0

Please sign in to comment.