Browse code

D[0][0] need not be initialized to 0

John Hawthorn authored on 31/08/2014 02:25:44
Showing 1 changed files

  • match.c index 5c68cd8..a50aab3 100644
... ...
@@ -111,7 +111,7 @@ double calculate_score(const char *needle, const char *haystack, size_t *positio
111 111
 
112 112
 	for(int i = 0; i < n; i++){
113 113
 		for(int j = 0; j < m; j++){
114
-			score_t score = (j || i) ? SCORE_MIN : 0;
114
+			score_t score = SCORE_MIN;
115 115
 			int match = tolower(needle[i]) == tolower(haystack[j]);
116 116
 			D[i][j] = SCORE_MIN;
117 117
 			if(match){