Bug 1372029 - Use EnsureInserted instead of Contains+PutEntry to avoid unnecessary hashtable lookups. r=froydnj

MozReview-Commit-ID: 7p0ZFLVGFEY
This commit is contained in:
Mats Palmgren 2017-06-17 00:06:04 +02:00
parent 5ef66d5e7d
commit f4bd97507a

View File

@ -933,11 +933,7 @@ nsHtml5TreeOpExecutor::ShouldPreloadURI(nsIURI *aURI)
nsAutoCString spec;
nsresult rv = aURI->GetSpec(spec);
NS_ENSURE_SUCCESS(rv, false);
if (mPreloadedURLs.Contains(spec)) {
return false;
}
mPreloadedURLs.PutEntry(spec);
return true;
return mPreloadedURLs.EnsureInserted(spec);
}
void