]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Use !empty instead of size when checking if containers are empty.
authorSadie Powell <sadie@witchery.services>
Wed, 16 Dec 2020 03:46:36 +0000 (03:46 +0000)
committerSadie Powell <sadie@witchery.services>
Wed, 16 Dec 2020 03:47:31 +0000 (03:47 +0000)
src/configreader.cpp
src/cull_list.cpp
src/modules/m_sasl.cpp

index d06753423af9df5b8779fabc2694fcadc01d7f81..b258d93fc052d84606102e0108c0caaa063fc135 100644 (file)
@@ -524,7 +524,7 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
                // On first run, ports are bound later on
                FailedPortList pl;
                ServerInstance->BindPorts(pl);
-               if (pl.size())
+               if (!pl.empty())
                {
                        std::cout << "Warning! Some of your listener" << (pl.size() == 1 ? "s" : "") << " failed to bind:" << std::endl;
                        for (FailedPortList::const_iterator iter = pl.begin(); iter != pl.end(); ++iter)
index e05d44918b0386fe95f5c83daa2a2f3afe8bc9bb..80d7ddb97bde802fe95be7414dc528340397253a 100644 (file)
@@ -73,7 +73,7 @@ void CullList::Apply()
                classbase* c = queue[i];
                delete c;
        }
-       if (list.size())
+       if (!list.empty())
        {
                ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "WARNING: Objects added to cull list in a destructor");
                Apply();
index 6aaa83f3371abf10cbc6392aec7bb9cf59f9677c..e202bae45181f8538153c6bc2417d59823548240 100644 (file)
@@ -213,7 +213,7 @@ class SaslAuthenticator
                params.push_back(method);
 
                const std::string fp = sslapi ? sslapi->GetFingerprint(user) : "";
-               if (fp.size())
+               if (!fp.empty())
                        params.push_back(fp);
 
                SendSASL(user, "*", 'S', params);