mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix any_of
This commit is contained in:
parent
ddc279c80f
commit
4da76e0e7d
|
@ -32,6 +32,7 @@ Checks: >
|
|||
-clang-analyzer-optin.cplusplus.VirtualCall,
|
||||
-clang-analyzer-optin.performance.Padding,
|
||||
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
|
||||
-clang-analyzer-security.insecureAPI.rand,
|
||||
misc-*,
|
||||
-misc-no-recursion,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
|
@ -40,6 +41,8 @@ Checks: >
|
|||
modernize-loop-convert,
|
||||
readability-*,
|
||||
-readability-braces-around-statements,
|
||||
-readability-convert-member-functions-to-static,
|
||||
-readability-else-after-return,
|
||||
-readability-function-cognitive-complexity,
|
||||
-readability-function-size,
|
||||
-readability-identifier-length,
|
||||
|
|
|
@ -24,7 +24,7 @@ static const char *VANILLA_SKINS[] = {"bluekitty", "bluestripe", "brownbear",
|
|||
|
||||
static bool IsVanillaSkin(const char *pName)
|
||||
{
|
||||
return std::all_of(std::begin(VANILLA_SKINS), std::end(VANILLA_SKINS), [pName](const char *pVanillaSkin) { return str_comp(pName, pVanillaSkin) == 0; });
|
||||
return std::any_of(std::begin(VANILLA_SKINS), std::end(VANILLA_SKINS), [pName](const char *pVanillaSkin) { return str_comp(pName, pVanillaSkin) == 0; });
|
||||
}
|
||||
|
||||
int CSkins::CGetPngFile::OnCompletion(int State)
|
||||
|
|
|
@ -69,14 +69,7 @@ static const char *VANILLA_IMAGES[] = {
|
|||
|
||||
static bool IsVanillaImage(const char *pImage)
|
||||
{
|
||||
for(const auto *pVanillaImage : VANILLA_IMAGES)
|
||||
{
|
||||
if(str_comp(pImage, pVanillaImage) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return std::any_of(std::begin(VANILLA_IMAGES), std::end(VANILLA_IMAGES), [pImage](const char *pVanillaImage) { return str_comp(pImage, pVanillaImage) == 0; });
|
||||
}
|
||||
|
||||
const void *CEditor::ms_pUiGotContext;
|
||||
|
|
|
@ -4102,12 +4102,7 @@ int CGameContext::GetClientVersion(int ClientID) const
|
|||
|
||||
bool CGameContext::PlayerModerating() const
|
||||
{
|
||||
for(const auto &pPlayer : m_apPlayers)
|
||||
{
|
||||
if(pPlayer && pPlayer->m_Moderating)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return std::any_of(std::begin(m_apPlayers), std::end(m_apPlayers), [](const CPlayer *pPlayer) { return pPlayer && pPlayer->m_Moderating; });
|
||||
}
|
||||
|
||||
void CGameContext::ForceVote(int EnforcerID, bool Success)
|
||||
|
|
Loading…
Reference in a new issue