Stylistic improvements.

This commit is contained in:
"Michael Hauser-Raspe" 2022-06-27 19:58:04 +01:00
parent 77cd2b32c7
commit 4aad9b7385
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ enum matching_mode {
}; };
int sort_for_matching_mode(const char *text1, const char *text2, int fallback, int sort_for_matching_mode(const char *text1, const char *text2, int fallback,
enum matching_mode match_type, const char *filter, bool insensitive); enum matching_mode match_type, const char *filter, bool insensitive);
bool match_for_matching_mode(const char* filter, const char* text, enum matching_mode matching, bool insensitive); bool match_for_matching_mode(const char* filter, const char* text, enum matching_mode matching, bool insensitive);
#endif #endif

View File

@ -81,7 +81,7 @@ static bool fuzzy_match(const char* filter, const char* text, bool insensitive)
} }
// we just check that all the characters (ignoring case) are in the // we just check that all the characters (ignoring case) are in the
// search text possibly case insensitively in the correct order // search text possibly case insensitively in the correct order
while(*filter) { while(*filter != 0) {
char nch = *filter++; char nch = *filter++;
if(!(text = strcasechr(text, nch, insensitive))) { if(!(text = strcasechr(text, nch, insensitive))) {
@ -229,7 +229,7 @@ static inline void match_row(int row, score_t* curr_D, score_t* curr_M,
// which has been implemented here. // which has been implemented here.
static score_t fuzzy_score(const char* haystack, const char* needle, bool insensitive) { static score_t fuzzy_score(const char* haystack, const char* needle, bool insensitive) {
if(!*needle) if(*needle == 0)
return SCORE_MIN; return SCORE_MIN;
int n = strlen(needle); int n = strlen(needle);