From 1244961c3fb0c76289bc94c6b66da7474838c556 Mon Sep 17 00:00:00 2001 From: elie Date: Sat, 12 Dec 2015 15:48:47 +0000 Subject: all SNMP counters now incremented via '+= 1' rather than 'x = x + 1' --- pysnmp/cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pysnmp/cache.py') diff --git a/pysnmp/cache.py b/pysnmp/cache.py index 46ad6020..49be826f 100644 --- a/pysnmp/cache.py +++ b/pysnmp/cache.py @@ -19,7 +19,7 @@ class Cache: return k in self.__cache def __getitem__(self, k): - self.__usage[k] = self.__usage[k] + 1 + self.__usage[k] += 1 return self.__cache[k] def __len__(self): @@ -34,7 +34,7 @@ class Cache: del self.__usage[_k] self.__size = self.__size - self.__chopSize if k not in self.__cache: - self.__size = self.__size + 1 + self.__size += 1 self.__usage[k] = 0 self.__cache[k] = v -- cgit v1.2.1