Bug 1202526 (part 5) - Use PLDHashTable::RemoveEntry() in nsSecureBrowserUIImpl. r=dkeeler.

This avoids repeating the hash table search in order to remove the entry.
This commit is contained in:
Nicholas Nethercote 2015-09-07 19:20:16 -07:00
parent 1cdf909da8
commit 0c46c656b9

View File

@ -872,8 +872,10 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress,
{
{ /* scope for the ReentrantMonitorAutoEnter */
ReentrantMonitorAutoEnter lock(mReentrantMonitor);
if (PL_DHashTableSearch(&mTransferringRequests, aRequest)) {
PL_DHashTableRemove(&mTransferringRequests, aRequest);
PLDHashEntryHdr* entry =
PL_DHashTableSearch(&mTransferringRequests, aRequest);
if (entry) {
mTransferringRequests.RemoveEntry(entry);
requestHasTransferedData = true;
}
}