Skip to content

Commit 6da25a7

Browse files
committed
Fixed sonar
1 parent 50d15a3 commit 6da25a7

File tree

1 file changed

+4
-3
lines changed
  • src/main/java/g3101_3200/s3123_find_edges_in_shortest_paths

1 file changed

+4
-3
lines changed

src/main/java/g3101_3200/s3123_find_edges_in_shortest_paths/Solution.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.Arrays;
77
import java.util.PriorityQueue;
88

9+
@SuppressWarnings({"java:S135", "java:S2234"})
910
public class Solution {
1011
private int[] edge;
1112
private int[] weight;
@@ -52,9 +53,9 @@ public boolean[] findAnswer(int n, int[][] edges) {
5253
if (u == n - 1) {
5354
break;
5455
}
55-
for (int index = head[u]; index != -1; index = next[index]) {
56-
int v = edge[index];
57-
int w = weight[index];
56+
for (int localIndex = head[u]; localIndex != -1; localIndex = next[localIndex]) {
57+
int v = edge[localIndex];
58+
int w = weight[localIndex];
5859
long newDistance = distance + w;
5960
if (newDistance < distances[v]) {
6061
distances[v] = newDistance;

0 commit comments

Comments
 (0)