Mozilla Home
Privacy
Cookies
Legal
Bugzilla
Browse
Advanced Search
New Bug
Reports
Documentation
Log In
Log In with GitHub
or
Remember me
Browse
Advanced Search
New Bug
Reports
Documentation
Attachment 491702 Details for
Bug 594223
[patch]
Patch v3
fewer-searchfunction-calls (text/plain), 2.13 KB, created by
Justin Lebar (not reading bugmail)
(
hide
)
Description:
Patch v3
Filename:
MIME Type:
Creator:
Justin Lebar (not reading bugmail)
Size:
2.13 KB
patch
obsolete
># HG changeset patch ># Parent 7e42ccaa7269cd8cf0ed30684bc4a718673710c4 >Bug 594223 - Don't call searchFunction unnecessarily in MatchAutoCompleteFunction::OnFunctionCall. r=sdwilsh > >diff --git a/toolkit/components/places/src/SQLFunctions.cpp b/toolkit/components/places/src/SQLFunctions.cpp >--- a/toolkit/components/places/src/SQLFunctions.cpp >+++ b/toolkit/components/places/src/SQLFunctions.cpp >@@ -388,31 +388,31 @@ namespace places { > (void)aArguments->GetUTF8String(kArgIndexTitle, title); > > // Determine if every token matches either the bookmark title, tags, page > // title, or page URL. > nsCWhitespaceTokenizer tokenizer(searchString); > 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_IF_ADDREF(*_result = new IntegerVariant(matches ? 1 : 0)); > NS_ENSURE_TRUE(*_result, NS_ERROR_OUT_OF_MEMORY); > return NS_OK; > #undef HAS_BEHAVIOR > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Flags:
sdwilsh
: approval2.0+
Actions:
View
|
Diff
|
Review
Attachments on
bug 594223
:
476413
|
480365
| 491702