Skip to content

Commit

Permalink
Remove duplicate variables
Browse files Browse the repository at this point in the history
  • Loading branch information
the-codeboy committed Jul 20, 2023
1 parent 20c8834 commit 9e7404c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public boolean canProvide() {

@Override
public ByteBuffer provide20MsAudio() {
return this.buffer.flip();
return (ByteBuffer) this.buffer.flip();
}

@Override
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/ml/codeboy/thebot/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ public void run() {
}
}
}, 1000, 5000);
} private static final int secondsPerDay = 3600 * 24,
secondsPerMonth = secondsPerDay * 30, secondsPerYear = secondsPerDay * 365;
}

public static int toInt(String string) {
return toInt(string, 0);
Expand Down Expand Up @@ -277,9 +276,9 @@ public static int calculateDistance(String from, String to) {
int cost = from.charAt(i - 1) == to.charAt(j - 1) ? 0 : 1;
dist[i][j] = Math.min(Math.min(dist[i - 1][j] + 1, dist[i][j - 1] + 1), dist[i - 1][j - 1] + cost);
if (i > 1 &&
j > 1 &&
from.charAt(i - 1) == to.charAt(j - 2) &&
from.charAt(i - 2) == to.charAt(j - 1)) {
j > 1 &&
from.charAt(i - 1) == to.charAt(j - 2) &&
from.charAt(i - 2) == to.charAt(j - 1)) {
dist[i][j] = Math.min(dist[i][j], dist[i - 2][j - 2] + cost);
}
}
Expand Down

0 comments on commit 9e7404c

Please sign in to comment.