From 61fb0e38f174fba0485af48f77fa666cfeb6e9c3 Mon Sep 17 00:00:00 2001 From: Scoopta Date: Sun, 26 Jan 2020 12:18:32 -0800 Subject: [PATCH] Improved the distance algorithm to take into account whether or not the result contains the search --- src/utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils.c b/src/utils.c index 2258dfb..6509c7e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -91,5 +91,9 @@ size_t utils_distance(const char* str1, const char* str2) { } } + if(strstr(str1, str2) != NULL) { + arr[str1_len][str2_len] -= str2_len; + } + return arr[str1_len][str2_len]; }