Merge pull request #1233 from dosuperuser/improvement/optimizations

Minor C++ optimizations
This commit is contained in:
Adam Ierymenko 2020-11-24 19:24:36 -05:00 committed by GitHub
commit d64c5a92c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 33 additions and 33 deletions

View file

@ -234,7 +234,7 @@ public:
}
// Get IPv4 addresses for each device
if (ifnames.size() > 0) {
if (!ifnames.empty()) {
const int controlfd = (int)socket(AF_INET,SOCK_DGRAM,0);
struct ifconf configuration;
configuration.ifc_len = 0;
@ -276,7 +276,7 @@ public:
if (controlfd > 0) close(controlfd);
}
const bool gotViaProc = (localIfAddrs.size() > 0);
const bool gotViaProc = (!localIfAddrs.empty());
#else
const bool gotViaProc = false;
#endif