Commit 2dc50605 authored by Adrien Béraud's avatar Adrien Béraud Committed by Guillaume Roguez

misc: use {} instead of {{}} to return empty std::map instance.

{{}} doesn't actually returns an empty std::map instance,
but create an empty entry into the map. So map.size() returns 1 than 0.
This can result into not wanted side effects.

Refs #74738

Change-Id: Ie78d137260ed3f34955b83ce59f408876d5b6e5b
parent d253d6cf
......@@ -390,7 +390,7 @@ Account::getDefaultCodecDetails(const unsigned& codecId)
return videoCodec->getCodecSpecifications();
}
}
return {{}};
return {};
}
#define find_iter() \
......
......@@ -132,8 +132,8 @@ class AccountFactory {
private:
mutable std::recursive_mutex mutex_ = {};
std::map<std::string, std::function<std::shared_ptr<Account>(const std::string&)> > generators_ = {{}};
std::map<std::string, AccountMap<Account> > accountMaps_ = {{}};
std::map<std::string, std::function<std::shared_ptr<Account>(const std::string&)> > generators_ = {};
std::map<std::string, AccountMap<Account> > accountMaps_ = {};
std::weak_ptr<Account> ip2ip_account_ = {}; //! cached pointer on IP2IP account
template <class T>
......
......@@ -162,7 +162,7 @@ validateCertificateRaw(const std::string&,
}
#else
RING_WARN("TLS not supported");
return {{}};
return {};
#endif
}
......@@ -178,7 +178,7 @@ getCertificateDetails(const std::string& certificate)
#else
RING_WARN("TLS not supported");
#endif
return {{}};
return {};
}
std::map<std::string, std::string>
......@@ -193,7 +193,7 @@ getCertificateDetailsRaw(const std::vector<uint8_t>& certificate_raw)
#else
RING_WARN("TLS not supported");
#endif
return {{}};
return {};
}
std::vector<std::string>
......@@ -287,7 +287,7 @@ getTrustRequests(const std::string& accountId)
{
if (auto acc = ring::Manager::instance().getAccount<ring::RingAccount>(accountId))
return acc->getTrustRequests();
return {{}};
return {};
}
bool
......@@ -325,7 +325,7 @@ getAccountTemplate(const std::string& accountType)
else if (accountType == Account::ProtocolNames::IAX)
return ring::IAXAccount("dummy").getAccountDetails();
#endif
return {{}};
return {};
}
std::string
......@@ -426,7 +426,7 @@ getCodecDetails(const std::string& accountID, const unsigned& codecId)
if (!codec)
{
ring::emitSignal<ConfigurationSignal::Error>(CODECS_NOT_LOADED);
return {{}};
return {};
}
if (codec->systemCodecInfo.mediaType & ring::MEDIA_AUDIO)
......@@ -438,7 +438,7 @@ getCodecDetails(const std::string& accountID, const unsigned& codecId)
return foundCodec->getCodecSpecifications();
ring::emitSignal<ConfigurationSignal::Error>(CODECS_NOT_LOADED);
return {{}};
return {};
}
std::vector<unsigned>
......
......@@ -2506,7 +2506,7 @@ Manager::getVolatileAccountDetails(const std::string& accountID) const
return account->getVolatileAccountDetails();
} else {
RING_ERR("Could not get volatile account details on a non-existing accountID %s", accountID.c_str());
return {{}};
return {};
}
}
......
......@@ -147,18 +147,18 @@ class PluginManager
nullptr, // set by PluginManager constructor
registerObjectFactory_, invokeService_,
};
PluginMap dynPluginMap_ = {{}}; // Only dynamic loaded plugins
PluginMap dynPluginMap_ = {}; // Only dynamic loaded plugins
ExitFuncVec exitFuncVec_ = {};
ObjectFactoryMap exactMatchMap_ = {{}};
ObjectFactoryMap exactMatchMap_ = {};
ObjectFactoryVec wildCardVec_ = {};
// Storage used during plugin initialisation.
// Will be copied into previous ones only if the initialisation success.
ObjectFactoryMap tempExactMatchMap_ = {{}};
ObjectFactoryMap tempExactMatchMap_ = {};
ObjectFactoryVec tempWildCardVec_ = {};
// registered services
std::map<std::string, ServiceFunction> services_ {{}};
std::map<std::string, ServiceFunction> services_ {};
};
} // namespace ring
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment