diff options
| author | Suad Halilovic <[email protected]> | 2020-07-16 18:31:56 +0200 |
|---|---|---|
| committer | Suad Halilovic <[email protected]> | 2020-07-16 18:31:56 +0200 |
| commit | ffebcd247fcc5fec9aee85c26da581cee8a09d72 (patch) | |
| tree | 2063d53161ed9a07caa22b7804d61d1bfaefef27 /one.cpp | |
| parent | b6b11dbf8242ff17c58f10f817d754da3f8c00eb (diff) | |
2020/07/16, Minor optmizations
Diffstat (limited to 'one.cpp')
| -rw-r--r-- | one.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -739,7 +739,7 @@ static int cli(int argc,char **argv) int addressCountOfType = 0; for (int k = 0; k<std::min(ZT_MAX_ZT_ASSIGNED_ADDRESSES, (int)assignedAddresses.size());++k) { nlohmann::json &addr = assignedAddresses[k]; - if ((arg2 == "ip4" && addr.get<std::string>().find(".") != std::string::npos) + if ((arg2 == "ip4" && addr.get<std::string>().find('.') != std::string::npos) || ((arg2.find("ip6") == 0) && addr.get<std::string>().find(":") != std::string::npos) || (arg2 == "ip") ) { @@ -754,19 +754,19 @@ static int cli(int argc,char **argv) if (arg2.find("ip6p") == 0) { if (arg2 == "ip6plane") { if (addr.get<std::string>().find("fc") == 0) { - aa.append(addr.get<std::string>().substr(0,addr.get<std::string>().find("/"))); + aa.append(addr.get<std::string>().substr(0,addr.get<std::string>().find('/'))); if (k < addressCountOfType-1) aa.append("\n"); } } if (arg2 == "ip6prefix") { if (addr.get<std::string>().find("fc") == 0) { - aa.append(addr.get<std::string>().substr(0,addr.get<std::string>().find("/")).substr(0,24)); + aa.append(addr.get<std::string>().substr(0,addr.get<std::string>().find('/')).substr(0,24)); if (k < addressCountOfType-1) aa.append("\n"); } } } else { - aa.append(addr.get<std::string>().substr(0,addr.get<std::string>().find("/"))); + aa.append(addr.get<std::string>().substr(0,addr.get<std::string>().find('/'))); if (k < addressCountOfType-1) aa.append("\n"); } } |
