| 33 | } |
| 34 | |
| 35 | AutoCompleteEntry* AutoCompleteBase::AddEntry(const AutoCompleteEntry& entry, const StringImpl& filter) |
| 36 | { |
| 37 | uint8 matches[256]; |
| 38 | |
| 39 | if (!DoesFilterMatch(entry.mDisplay, filter.c_str(), entry.mScore, matches, 256) || (entry.mNamePrefixCount < 0)) |
| 40 | return NULL; |
| 41 | |
| 42 | entry.mMatchesLength = mDoFuzzyAutoComplete ? u8_strlen((char*)filter.c_str()) : 0; |
| 43 | entry.mMatches = (entry.mMatchesLength > 0) ? matches : nullptr; |
| 44 | |
| 45 | auto result = AddEntry(entry); |
| 46 | |
| 47 | // Reset matches because the array will be invalid after return |
| 48 | entry.mMatches = nullptr; |
| 49 | entry.mMatchesLength = 0; |
| 50 | |
| 51 | return result; |
| 52 | } |
| 53 | |
| 54 | AutoCompleteEntry* AutoCompleteBase::AddEntry(const AutoCompleteEntry& entry, const char* filter) |
| 55 | { |
no test coverage detected