mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 10:37:33 -07:00
2020/07/16, Minor optmizations
This commit is contained in:
parent
b6b11dbf82
commit
ffebcd247f
11 changed files with 34 additions and 33 deletions
|
@ -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
|
||||
|
|
|
@ -351,7 +351,7 @@ std::vector<std::string> OSUtils::split(const char *s,const char *const sep,cons
|
|||
else if ((buf.size() <= 0)&&((quotTmp = strchr(quot,*s))))
|
||||
quoteState = *quotTmp;
|
||||
else if (strchr(sep,*s)) {
|
||||
if (buf.size() > 0) {
|
||||
if (!buf.empty()) {
|
||||
fields.push_back(buf);
|
||||
buf.clear();
|
||||
} // else skip runs of separators
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue