diff --git a/Common++/src/IpAddress.cpp b/Common++/src/IpAddress.cpp index 4c607ef7d..e337a6f52 100644 --- a/Common++/src/IpAddress.cpp +++ b/Common++/src/IpAddress.cpp @@ -524,9 +524,9 @@ namespace pcpp uint64_t IPv6Network::getTotalAddressCount() const { int numOfBitset = 0; - for (const unsigned char byteIndex : m_Mask) + for (const auto &byte : m_Mask) { - const std::bitset<8> bitset(static_cast(~byteIndex)); + const std::bitset<8> bitset(static_cast(~byte)); numOfBitset += static_cast(bitset.count()); }