Skip to content

Commit

Permalink
Bug 1187141 - Replace nsBaseHashtable::Enumerate() calls in storage/ …
Browse files Browse the repository at this point in the history
…with iterators. r=mak.
  • Loading branch information
nnethercote committed Jan 25, 2016
1 parent 1c78cfa commit abf6838
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions storage/StatementCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ class StatementCache {
void
FinalizeStatements()
{
(void)mCachedStatements.Enumerate(FinalizeCachedStatements, nullptr);
for (auto iter = mCachedStatements.Iter(); !iter.Done(); iter.Next()) {
(void)iter.Data()->Finalize();
}

// Clear the cache at this time too!
(void)mCachedStatements.Clear();
Expand All @@ -89,15 +91,6 @@ class StatementCache {
inline
already_AddRefed<StatementType>
CreateStatement(const nsACString& aQuery);
static
PLDHashOperator
FinalizeCachedStatements(const nsACString& aKey,
nsCOMPtr<StatementType>& aStatement,
void*)
{
(void)aStatement->Finalize();
return PL_DHASH_NEXT;
}

nsInterfaceHashtable<nsCStringHashKey, StatementType> mCachedStatements;
nsCOMPtr<mozIStorageConnection>& mConnection;
Expand Down

0 comments on commit abf6838

Please sign in to comment.