Skip to content

Commit 31e8229

Browse files
committed
style(pmd): remove unnecessary return in validate()
1 parent 81055dc commit 31e8229

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,6 @@ private static void validate(int[][] weights, int src, int dst, int k) {
131131
if (k < 1) {
132132
throw new IllegalArgumentException("k must be >= 1");
133133
}
134-
if (src == dst) {
135-
// allowed: path is [src] with cost 0 (handled by dijkstra)
136-
return;
137-
}
138134
}
139135

140136
private static boolean startsWith(List<Integer> list, List<Integer> prefix) {

0 commit comments

Comments
 (0)