Skip to content

Commit 81055dc

Browse files
committed
style(pmd): fix EmptyControlStatement in validate() by returning early when src==dst
1 parent 65dd4d9 commit 81055dc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/com/thealgorithms/graph/YensKShortestPaths.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ private static void validate(int[][] weights, int src, int dst, int k) {
133133
}
134134
if (src == dst) {
135135
// allowed: path is [src] with cost 0 (handled by dijkstra)
136+
return;
136137
}
137138
}
138139

0 commit comments

Comments
 (0)