mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Improved performance of fuzzy string matching
This commit is contained in:
parent
b70745ef1e
commit
04888b8f10
4 changed files with 79 additions and 70 deletions
|
@ -8024,26 +8024,25 @@ void BfCompiler::GenerateAutocompleteInfo()
|
|||
autoCompleteResultString += '@';
|
||||
autoCompleteResultString += String(entry->mDisplay);
|
||||
|
||||
autoCompleteResultString += "\x02";
|
||||
for (int i = 0; i < 256; i++)
|
||||
if (entry->mMatchesLength > 0)
|
||||
{
|
||||
int match = entry->mMatches[i];
|
||||
autoCompleteResultString += "\x02";
|
||||
for (int i = 0; i < entry->mMatchesLength; i++)
|
||||
{
|
||||
int match = entry->mMatches[i];
|
||||
|
||||
// no more matches after this
|
||||
if (match == 0 && i != 0)
|
||||
break;
|
||||
// Need max 3 chars (largest Hex (FF) + '\0')
|
||||
char buffer[3];
|
||||
|
||||
// Need max 3 chars (largest Hex (FF) + '\0')
|
||||
char buffer[3];
|
||||
_itoa_s(match, buffer, 16);
|
||||
|
||||
_itoa_s(match, buffer, 16);
|
||||
autoCompleteResultString += String(buffer);
|
||||
autoCompleteResultString += ",";
|
||||
}
|
||||
|
||||
autoCompleteResultString += String(buffer);
|
||||
autoCompleteResultString += ",";
|
||||
autoCompleteResultString += "X";
|
||||
}
|
||||
|
||||
autoCompleteResultString += "X";
|
||||
|
||||
if (entry->mDocumentation != NULL)
|
||||
{
|
||||
autoCompleteResultString += '\x03';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue