diff --git a/gfx/thebes/gfxFT2FontList.cpp b/gfx/thebes/gfxFT2FontList.cpp index e246c478d996..0447455927eb 100644 --- a/gfx/thebes/gfxFT2FontList.cpp +++ b/gfx/thebes/gfxFT2FontList.cpp @@ -650,7 +650,21 @@ public: } nsAutoCString buf; - PL_DHashTableEnumerate(&mMap, WriteOutMap, &buf); + for (auto iter = mMap.Iter(); !iter.Done(); iter.Next()) { + auto entry = static_cast(iter.Get()); + if (!entry->mFileExists) { + // skip writing entries for files that are no longer present + continue; + } + buf.Append(entry->mFilename); + buf.Append(';'); + buf.Append(entry->mFaces); + buf.Append(';'); + buf.AppendInt(entry->mTimestamp); + buf.Append(';'); + buf.AppendInt(entry->mFilesize); + buf.Append(';'); + } mCache->PutBuffer(CACHE_KEY, buf.get(), buf.Length() + 1); } @@ -748,28 +762,6 @@ private: PLDHashTableOps mOps; - static PLDHashOperator WriteOutMap(PLDHashTable *aTable, - PLDHashEntryHdr *aHdr, - uint32_t aNumber, void *aData) - { - FNCMapEntry* entry = static_cast(aHdr); - if (!entry->mFileExists) { - // skip writing entries for files that are no longer present - return PL_DHASH_NEXT; - } - - nsAutoCString* buf = reinterpret_cast(aData); - buf->Append(entry->mFilename); - buf->Append(';'); - buf->Append(entry->mFaces); - buf->Append(';'); - buf->AppendInt(entry->mTimestamp); - buf->Append(';'); - buf->AppendInt(entry->mFilesize); - buf->Append(';'); - return PL_DHASH_NEXT; - } - typedef struct : public PLDHashEntryHdr { public: nsCString mFilename;