mirror of
https://github.com/NixOS/nix
synced 2025-07-05 16:31:47 +02:00
SymbolStr: Remove std::string conversion
This refactoring allows the symbol table to be stored as something other than std::strings.
This commit is contained in:
parent
0363dbf2b9
commit
61080554ab
15 changed files with 37 additions and 37 deletions
|
@ -38,8 +38,8 @@ int levenshteinDistance(std::string_view first, std::string_view second)
|
|||
}
|
||||
|
||||
Suggestions Suggestions::bestMatches (
|
||||
std::set<std::string> allMatches,
|
||||
std::string query)
|
||||
const std::set<std::string> & allMatches,
|
||||
std::string_view query)
|
||||
{
|
||||
std::set<Suggestion> res;
|
||||
for (const auto & possibleMatch : allMatches) {
|
||||
|
|
|
@ -35,8 +35,8 @@ public:
|
|||
) const;
|
||||
|
||||
static Suggestions bestMatches (
|
||||
std::set<std::string> allMatches,
|
||||
std::string query
|
||||
const std::set<std::string> & allMatches,
|
||||
std::string_view query
|
||||
);
|
||||
|
||||
Suggestions& operator+=(const Suggestions & other);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue