Apply squashed changes from alexxxe
@@ -69,8 +69,7 @@ class Counter(Integer):
def __init__(self, value):
# type: (int) -> None
- while value >= 2**32:
- value = value - (2**32)
+ value &= 0xFFFFFFFF if value >= 2 ** 32 else value
if value <= 0:
value = 0
super(Counter, self).__init__(value)
@@ -129,8 +128,7 @@ class Counter64(Integer):
def __init__(self, value):
# type: (int) -> None
- while value >= 2**64:
- value = value - (2**64)
+ value &= 0xFFFFFFFFFFFFFFFF if value >= 2 ** 64 else value
if value <= 0:
value = 0
super(Counter64, self).__init__(value)
