1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +00:00

AK: Do not require an allocated String for fuzzy matching

A StringView is sufficient here. This also removes the declaration of
fuzzy_match_recursive from the header, as it's only needed from within
the implementation file.
This commit is contained in:
Timothy Flynn 2022-09-18 13:44:23 -04:00 committed by Sam Atkins
parent d4acdac317
commit 11bd6c3d68
2 changed files with 5 additions and 8 deletions

View file

@ -6,7 +6,7 @@
#pragma once
#include <AK/String.h>
#include <AK/StringView.h>
namespace AK {
@ -15,10 +15,7 @@ struct FuzzyMatchResult {
int score { 0 };
};
FuzzyMatchResult fuzzy_match_recursive(String const& needle, String const& haystack, size_t needle_idx, size_t haystack_idx,
u8 const* src_matches, u8* matches, int next_match, int& recursion_count);
FuzzyMatchResult fuzzy_match(String const& needle, String const& haystack);
FuzzyMatchResult fuzzy_match(StringView needle, StringView haystack);
}