mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1372029 - Use EnsureInserted instead of Contains+PutEntry to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: 7p0ZFLVGFEY
This commit is contained in:
parent
5ef66d5e7d
commit
f4bd97507a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user