mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 594223 - Don't call searchFunction unnecessarily in MatchAutoCompleteFunction::OnFunctionCall. r,a=sdwilsh
This commit is contained in:
parent
37f895fef1
commit
89c81d0188
@ -395,21 +395,21 @@ namespace places {
|
||||
while (matches && tokenizer.hasMoreTokens()) {
|
||||
const nsDependentCSubstring &token = tokenizer.nextToken();
|
||||
|
||||
bool matchTags = searchFunction(token, tags);
|
||||
bool matchTitle = searchFunction(token, title);
|
||||
|
||||
// Make sure we match something in the title or tags if we have to.
|
||||
matches = matchTags || matchTitle;
|
||||
if (HAS_BEHAVIOR(TITLE) && !matches)
|
||||
break;
|
||||
|
||||
bool matchURL = searchFunction(token, fixedURI);
|
||||
// If we do not match the URL when we have to, reset matches to false.
|
||||
// Otherwise, keep track that we did match the current search.
|
||||
if (HAS_BEHAVIOR(URL) && !matchURL)
|
||||
matches = false;
|
||||
else
|
||||
matches = matches || matchURL;
|
||||
if (HAS_BEHAVIOR(TITLE) && HAS_BEHAVIOR(URL)) {
|
||||
matches = (searchFunction(token, title) || searchFunction(token, tags)) &&
|
||||
searchFunction(token, fixedURI);
|
||||
}
|
||||
else if (HAS_BEHAVIOR(TITLE)) {
|
||||
matches = searchFunction(token, title) || searchFunction(token, tags);
|
||||
}
|
||||
else if (HAS_BEHAVIOR(URL)) {
|
||||
matches = searchFunction(token, fixedURI);
|
||||
}
|
||||
else {
|
||||
matches = searchFunction(token, title) ||
|
||||
searchFunction(token, tags) ||
|
||||
searchFunction(token, fixedURI);
|
||||
}
|
||||
}
|
||||
|
||||
NS_ADDREF(*_result = new IntegerVariant(matches ? 1 : 0));
|
||||
|
Loading…
Reference in New Issue
Block a user