Skip to content

Commit

Permalink
min to minInt & fix too long line
Browse files Browse the repository at this point in the history
  • Loading branch information
amelie-certin committed Dec 11, 2016
1 parent 7324269 commit 9e2e92c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/gestrech.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ int levenshtein(char *str1, char *str2) {
int last_cost = i + 1;
for (size_t j = 0; j < size2; j++) {
int sub_cost = (str1[i] == str2[j]) ? 0 : 1;
int cost = min(min(last_cost + 1, val[j + 1] + 1), val[j] + sub_cost);
int cost = minInt(last_cost + 1, val[j + 1] + 1);
cost = minInt(cost, val[j] + sub_cost);
val[j] = last_cost;
last_cost = cost;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ char *toLowerCase(char *str) {
* \param b Integer
* \return Integer the lower value between the two given Integers
*/
int min(int a, int b) {
int minInt(int a, int b) {
if(a < b) {
return a;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ char *toLowerCase(char *str);
char **strSortedMakeUniq(char **strings, int *size);
void swapChar(char **a, char **b);
void quickSort(char **array, int start, int end);
int min(int a, int b);
int minInt(int a, int b);

#endif /* end of include guard: */

0 comments on commit 9e2e92c

Please sign in to comment.