Backed out changeset f4467b37dfef for test failures. a=testfailure
authorDave Camp <dcamp@mozilla.com>
Thu, 20 Dec 2012 17:35:01 -0800
changeset 117778 878ffb3da483162cdbce59faeb12acaf0b1c306c
parent 117777 f4467b37dfef0ab3dcb31622943e2774affdfb00
child 117779 d169db669f311fbabe8cc3bc9aad4f9a4ace1052
push id75
push userdbaron@mozilla.com
push dateSat, 22 Dec 2012 00:41:31 +0000
reviewerstestfailure
milestone18.0
backs outf4467b37dfef0ab3dcb31622943e2774affdfb00
Backed out changeset f4467b37dfef for test failures. a=testfailure
toolkit/components/url-classifier/LookupCache.cpp
--- a/toolkit/components/url-classifier/LookupCache.cpp
+++ b/toolkit/components/url-classifier/LookupCache.cpp
@@ -194,16 +194,24 @@ nsresult
 LookupCache::Has(const Completion& aCompletion,
                  const Completion& aHostkey,
                  const uint32_t aHashKey,
                  bool* aHas, bool* aComplete,
                  Prefix* aOrigPrefix)
 {
   *aHas = *aComplete = false;
 
+  // check completion store first
+  if (mCompletions.BinaryIndexOf(aCompletion) != nsTArray<Completion>::NoIndex) {
+    LOG(("Complete in %s", mTableName.get()));
+    *aComplete = true;
+    *aHas = true;
+    return NS_OK;
+  }
+
   uint32_t prefix = aCompletion.ToUint32();
   uint32_t hostkey = aHostkey.ToUint32();
   uint32_t codedkey;
   nsresult rv = KeyedHash(prefix, hostkey, aHashKey, &codedkey, !mPerClientRandomize);
   NS_ENSURE_SUCCESS(rv, rv);
 
   Prefix codedPrefix;
   codedPrefix.FromUint32(codedkey);
@@ -212,21 +220,16 @@ LookupCache::Has(const Completion& aComp
   bool found;
   rv = mPrefixSet->Contains(codedkey, &found);
   NS_ENSURE_SUCCESS(rv, rv);
 
   LOG(("Probe in %s: %X, found %d", mTableName.get(), prefix, found));
 
   if (found) {
     *aHas = true;
-    // check completion store
-    if (mCompletions.BinaryIndexOf(aCompletion) != nsTArray<Completion>::NoIndex) {
-      LOG(("Complete in %s", mTableName.get()));
-      *aComplete = true;
-    }
   }
 
   return NS_OK;
 }
 
 nsresult
 LookupCache::WriteFile()
 {