Bug 1287277 - Silly micro-optimization. r=mak
authorSimon Lindholm <simon.lindholm10@gmail.com>
Thu, 14 Jul 2016 14:10:20 +0200
changeset 332248 ca925530409a23a33fe6bc35e6cbed8a71016cff
parent 332247 dcb3c6e5c58b9f855c9c2aef44f7a10428a4e802
child 332249 a83df31aa5bd32260b8f2789a240424f09f876da
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1287277
milestone50.0a1
Bug 1287277 - Silly micro-optimization. r=mak
toolkit/components/places/SQLFunctions.cpp
--- a/toolkit/components/places/SQLFunctions.cpp
+++ b/toolkit/components/places/SQLFunctions.cpp
@@ -352,19 +352,19 @@ namespace places {
     nsDependentCString url =
       getSharedString(aArguments, kArgIndexURL);
 
     int32_t matchBehavior = aArguments->AsInt32(kArgIndexMatchBehavior);
 
     // We only want to filter javascript: URLs if we are not supposed to search
     // for them, and the search does not start with "javascript:".
     if (matchBehavior != mozIPlacesAutoComplete::MATCH_ANYWHERE_UNMODIFIED &&
+        StringBeginsWith(url, NS_LITERAL_CSTRING("javascript:")) &&
         !HAS_BEHAVIOR(JAVASCRIPT) &&
-        !StringBeginsWith(searchString, NS_LITERAL_CSTRING("javascript:")) &&
-        StringBeginsWith(url, NS_LITERAL_CSTRING("javascript:"))) {
+        !StringBeginsWith(searchString, NS_LITERAL_CSTRING("javascript:"))) {
       NS_ADDREF(*_result = new IntegerVariant(0));
       return NS_OK;
     }
 
     int32_t visitCount = aArguments->AsInt32(kArgIndexVisitCount);
     bool typed = aArguments->AsInt32(kArgIndexTyped) ? true : false;
     bool bookmark = aArguments->AsInt32(kArgIndexBookmark) ? true : false;
     nsDependentCString tags = getSharedString(aArguments, kArgIndexTags);