refactoring

This commit is contained in:
Proddy
2024-02-12 14:21:30 +01:00
parent ed5f0bc6d5
commit 80a3007f8b
56 changed files with 555 additions and 516 deletions

View File

@@ -3,16 +3,20 @@
#include <IPAddress.h>
const IPAddress IP_NOT_SET = IPAddress(INADDR_NONE);
class IPUtils {
public:
static bool isSet(const IPAddress & ip) {
return ip != IP_NOT_SET;
return ip != getNotSetIP();
}
static bool isNotSet(const IPAddress & ip) {
return ip == IP_NOT_SET;
return ip == getNotSetIP();
}
private:
static const IPAddress & getNotSetIP() {
static const IPAddress IP_NOT_SET = IPAddress(INADDR_NONE);
return IP_NOT_SET;
}
};
#endif
#endif