зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
cbac1e147a
Коммит
a04c29f828
|
@ -2112,16 +2112,6 @@ public:
|
||||||
return aMallocSizeOf(this) + shallowSizeOfExcludingThis(aMallocSizeOf);
|
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
|
MOZ_ALWAYS_INLINE Ptr readonlyThreadsafeLookup(const Lookup& aLookup) const
|
||||||
{
|
{
|
||||||
if (!HasHash<HashPolicy>(aLookup)) {
|
if (!HasHash<HashPolicy>(aLookup)) {
|
||||||
|
@ -2131,6 +2121,12 @@ public:
|
||||||
return Ptr(lookup<ForNonAdd>(aLookup, keyHash), *this);
|
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
|
MOZ_ALWAYS_INLINE AddPtr lookupForAdd(const Lookup& aLookup) const
|
||||||
{
|
{
|
||||||
ReentrancyGuard g(*this);
|
ReentrancyGuard g(*this);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче