Skip to content

Commit 82b9c81

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] sonarlint fixes
1 parent 66b2edb commit 82b9c81

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/projecteuler/helpers/matrix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
def matrix(t_n: int, t_m: int, init: int | None) -> List[List[int]]:
66
result = []
77

8-
for i in range(0, t_n):
9-
result.append([init for i in range(t_m)])
8+
for _ in range(0, t_n):
9+
result.append([init for _ in range(t_m)])
1010
return result

src/projecteuler/lib/binary_node_builder.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@ def build_binary_node_tree_weigth(
6565
)
6666
)
6767

68-
if result_node.is_leaf():
69-
if leaves_collector is not None:
70-
leaves_collector.append(current_value)
68+
if result_node.is_leaf() and leaves_collector is not None:
69+
leaves_collector.append(current_value)
7170

7271
return result_node
7372

0 commit comments

Comments
 (0)