Skip to content

Commit c1af4ef

Browse files
authored
Fixed checkstyle and sonar warnings.
1 parent 63d9b22 commit c1af4ef

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

checkstyle.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
<property name="allowUnknownTags" value="true"/>
141141
</module>
142142
<module name="MethodName">
143-
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
143+
<property name="format" value="^[a-z][a-z0-9]*[a-zA-Z0-9_]*$"/>
144144
<message key="name.invalidPattern"
145145
value="Method name ''{0}'' must match pattern ''{1}''."/>
146146
</module>

src/main/java/g0701_0800/s0743_network_delay_time/Solution.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ public int networkDelayTime(int[][] times, int n, int k) {
2626
int curr = spfa.poll();
2727
visited[curr] = false;
2828
for (int i = 1; i <= n; i++) {
29-
if (graph[curr][i] != -1) {
30-
if (dist[i] > dist[curr] + graph[curr][i]) {
31-
dist[i] = dist[curr] + graph[curr][i];
32-
if (!visited[i]) {
33-
spfa.add(i);
34-
visited[i] = true;
35-
}
29+
if (graph[curr][i] != -1 && dist[i] > dist[curr] + graph[curr][i]) {
30+
dist[i] = dist[curr] + graph[curr][i];
31+
if (!visited[i]) {
32+
spfa.add(i);
33+
visited[i] = true;
3634
}
3735
}
3836
}

src/main/java/g0701_0800/s0745_prefix_and_suffix_search/TrieNode.java

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package g0701_0800.s0745_prefix_and_suffix_search;
22

3+
@SuppressWarnings("java:S1104")
34
class TrieNode {
45
public TrieNode[] children;
56
public int weight;

0 commit comments

Comments
 (0)