Bug 1411480 - Inline and remove PREF_GetPrefType(). r=glandium.

It has a single call site.

MozReview-Commit-ID: o5CwR8Od7o

--HG--
extra : rebase_source : 2f24a0bc7fa65af8cb60b820982c8d6cb8ee5298
This commit is contained in:
Nicholas Nethercote 2017-10-25 10:22:38 +11:00
parent 5eeb08fa63
commit 21290f6159

View File

@ -1158,18 +1158,6 @@ pref_SizeOfPrivateData(MallocSizeOf aMallocSizeOf)
return n;
}
static PrefType
PREF_GetPrefType(const char* aPrefName)
{
if (gHashTable) {
PrefHashEntry* pref = pref_HashTableLookup(aPrefName);
if (pref) {
return pref->mPrefFlags.GetPrefType();
}
}
return PrefType::Invalid;
}
// Bool function that returns whether or not the preference is locked and
// therefore cannot be changed.
static bool
@ -2315,8 +2303,17 @@ NS_IMETHODIMP
nsPrefBranch::GetPrefType(const char* aPrefName, int32_t* aRetVal)
{
NS_ENSURE_ARG(aPrefName);
const PrefName& pref = GetPrefName(aPrefName);
switch (PREF_GetPrefType(pref.get())) {
PrefType type = PrefType::Invalid;
if (gHashTable) {
PrefHashEntry* entry = pref_HashTableLookup(pref.get());
if (entry) {
type = entry->mPrefFlags.GetPrefType();
}
}
switch (type) {
case PrefType::String:
*aRetVal = PREF_STRING;
break;