sources/network/bytestream.cpp

changeset 185
e83ec58cc458
parent 183
9b6a0daedfc0
child 190
90bf9049e5eb
--- a/sources/network/bytestream.cpp	Wed Jan 27 14:06:45 2021 +0200
+++ b/sources/network/bytestream.cpp	Wed Jan 27 14:16:58 2021 +0200
@@ -90,7 +90,7 @@
 	ensureReadSpace (2);
 	int16_t result = 0;
 
-	for (int i : range(2))
+	for (int i : {0, 1})
 		result |= read() << (i * 8);
 
 	return result;
@@ -104,8 +104,8 @@
 {
 	ensureReadSpace (4);
 	int32_t result = 0;
-
-	for (int i : range(4))
+	
+	for (int i = 0; i < 4; i += 1)
 		result |= read() << (i * 8);
 
 	return result;
@@ -170,7 +170,7 @@
 void Bytestream::writeShort(int16_t value)
 {
 	m_data.reserve(m_data.size() + 2);
-	for (int i : range(2))
+	for (int i : {0, 1})
 		m_data.push_back((value >> (i * 8)) & 0xFF);
 }
 
@@ -181,7 +181,7 @@
 void Bytestream::writeLong(int32_t value)
 {
 	m_data.reserve(m_data.size() + 4);
-	for (int i : range(4))
+	for (int i = 0; i < 4; i += 1)
 		m_data.push_back((value >> (i * 8)) & 0xFF);
 }
 

mercurial