Bug 1170416 (part 5) - Remove PLDHashTable::IsInitialized(). r=froydnj.

|mOps| is always non-null now, and there's no longer any distinction between
and uninitialized and initialized table. Yay.
This commit is contained in:
Nicholas Nethercote
2015-05-20 21:23:55 -07:00
parent f5e23a7693
commit 920bcd7199
14 changed files with 13 additions and 116 deletions

View File

@@ -164,13 +164,11 @@ nsFrameManager::GetPlaceholderFrameFor(const nsIFrame* aFrame)
{
NS_PRECONDITION(aFrame, "null param unexpected");
if (mPlaceholderMap.IsInitialized()) {
PlaceholderMapEntry *entry = static_cast<PlaceholderMapEntry*>
(PL_DHashTableSearch(const_cast<PLDHashTable*>(&mPlaceholderMap),
aFrame));
if (entry) {
return entry->placeholderFrame;
}
PlaceholderMapEntry *entry = static_cast<PlaceholderMapEntry*>
(PL_DHashTableSearch(const_cast<PLDHashTable*>(&mPlaceholderMap),
aFrame));
if (entry) {
return entry->placeholderFrame;
}
return nullptr;
@@ -201,10 +199,8 @@ nsFrameManager::UnregisterPlaceholderFrame(nsPlaceholderFrame* aPlaceholderFrame
NS_PRECONDITION(nsGkAtoms::placeholderFrame == aPlaceholderFrame->GetType(),
"unexpected frame type");
if (mPlaceholderMap.IsInitialized()) {
PL_DHashTableRemove(&mPlaceholderMap,
aPlaceholderFrame->GetOutOfFlowFrame());
}
PL_DHashTableRemove(&mPlaceholderMap,
aPlaceholderFrame->GetOutOfFlowFrame());
}
static PLDHashOperator
@@ -219,10 +215,8 @@ UnregisterPlaceholders(PLDHashTable* table, PLDHashEntryHdr* hdr,
void
nsFrameManager::ClearPlaceholderFrameMap()
{
if (mPlaceholderMap.IsInitialized()) {
PL_DHashTableEnumerate(&mPlaceholderMap, UnregisterPlaceholders, nullptr);
mPlaceholderMap.Clear();
}
PL_DHashTableEnumerate(&mPlaceholderMap, UnregisterPlaceholders, nullptr);
mPlaceholderMap.Clear();
}
//----------------------------------------------------------------------