Bug 1312339 - LookupResult to support variable length partial hash. r=francois
MozReview-Commit-ID: DKwNCNKJAW
This commit is contained in:
@@ -421,9 +421,11 @@ LookupCacheV2::ClearAll()
|
||||
|
||||
nsresult
|
||||
LookupCacheV2::Has(const Completion& aCompletion,
|
||||
bool* aHas, bool* aComplete)
|
||||
bool* aHas, bool* aComplete,
|
||||
uint32_t* aMatchLength)
|
||||
{
|
||||
*aHas = *aComplete = false;
|
||||
*aMatchLength = 0;
|
||||
|
||||
uint32_t prefix = aCompletion.ToUint32();
|
||||
|
||||
@@ -435,6 +437,7 @@ LookupCacheV2::Has(const Completion& aCompletion,
|
||||
|
||||
if (found) {
|
||||
*aHas = true;
|
||||
*aMatchLength = PREFIX_SIZE;
|
||||
}
|
||||
|
||||
if ((mGetHashCache.BinaryIndexOf(aCompletion) != nsTArray<Completion>::NoIndex) ||
|
||||
@@ -442,6 +445,7 @@ LookupCacheV2::Has(const Completion& aCompletion,
|
||||
LOG(("Complete in %s", mTableName.get()));
|
||||
*aComplete = true;
|
||||
*aHas = true;
|
||||
*aMatchLength = COMPLETE_SIZE;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
||||
Reference in New Issue
Block a user