Skip to content

Commit d8000d1

Browse files
authored
Merge pull request #34 from fabiankessler/master
LongestCommonSubsequence: no need to initialize int[] with zero
2 parents 14128b3 + 0965189 commit d8000d1

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/main/java/info/debatty/java/stringsimilarity/LongestCommonSubsequence.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,6 @@ public final int length(final String s1, final String s2) {
9494

9595
int[][] c = new int[m + 1][n + 1];
9696

97-
for (int i = 0; i <= m; i++) {
98-
c[i][0] = 0;
99-
}
100-
101-
for (int j = 0; j <= n; j++) {
102-
c[0][j] = 0;
103-
}
104-
10597
for (int i = 1; i <= m; i++) {
10698
for (int j = 1; j <= n; j++) {
10799
if (x[i - 1] == y[j - 1]) {

0 commit comments

Comments
 (0)