sources/network/ipaddress.cpp

changeset 137
485cb6d6b98c
parent 109
e4966d7e615d
child 145
d0aedc9be448
--- a/sources/network/ipaddress.cpp	Fri May 15 22:46:53 2015 +0300
+++ b/sources/network/ipaddress.cpp	Wed Jul 20 14:48:47 2016 +0300
@@ -98,7 +98,7 @@
 //
 bool IPAddress::compare (const IPAddress& other) const
 {
-	for (int i = 0; i < 4; ++i)
+	for (int i : range(4))
 	{
 		if (octet (i) != other.octet (i))
 			return false;
@@ -118,7 +118,7 @@
 //
 bool IPAddress::operator< (const IPAddress& other) const
 {
-	for (int i = 0; i < 4; ++i)
+	for (int i : range(4))
 	{
 		if (octet (i) != other.octet (i))
 			return octet (i) < other.octet (i);
@@ -151,7 +151,7 @@
 	// Try scanf the IPv4 host first
 	if (sscanf (addressString, "%u.%u.%u.%u", &parts[0], &parts[1], &parts[2], &parts[3]))
 	{
-		for (short i = 0; i < 4; ++i)
+		for (int i : range(4))
 			value.set_octet (i, parts[i]);
 	}
 	else

mercurial