Bug 1481998 - Define lookup() in terms of readonlyThreadsafeLookup(). r=luke

The two functions are almost identical. This change minimizes duplication.

--HG--
extra : rebase_source : 08bb79d21084eec63702525ce6179e22686bec5c
This commit is contained in:
Nicholas Nethercote 2018-08-10 15:35:13 +10:00
Родитель cbac1e147a
Коммит a04c29f828
1 изменённых файлов: 6 добавлений и 10 удалений

Просмотреть файл

@ -2112,16 +2112,6 @@ public:
return aMallocSizeOf(this) + shallowSizeOfExcludingThis(aMallocSizeOf);
}
MOZ_ALWAYS_INLINE Ptr lookup(const Lookup& aLookup) const
{
ReentrancyGuard g(*this);
if (!HasHash<HashPolicy>(aLookup)) {
return Ptr();
}
HashNumber keyHash = prepareHash(aLookup);
return Ptr(lookup<ForNonAdd>(aLookup, keyHash), *this);
}
MOZ_ALWAYS_INLINE Ptr readonlyThreadsafeLookup(const Lookup& aLookup) const
{
if (!HasHash<HashPolicy>(aLookup)) {
@ -2131,6 +2121,12 @@ public:
return Ptr(lookup<ForNonAdd>(aLookup, keyHash), *this);
}
MOZ_ALWAYS_INLINE Ptr lookup(const Lookup& aLookup) const
{
ReentrancyGuard g(*this);
return readonlyThreadsafeLookup(aLookup);
}
MOZ_ALWAYS_INLINE AddPtr lookupForAdd(const Lookup& aLookup) const
{
ReentrancyGuard g(*this);