summaryrefslogtreecommitdiff
path: root/pysnmp/cache.py
diff options
context:
space:
mode:
authorelie <elie>2015-12-12 15:48:47 +0000
committerelie <elie>2015-12-12 15:48:47 +0000
commit1244961c3fb0c76289bc94c6b66da7474838c556 (patch)
tree59c463ef9cb75b7c1a3a4c3681b4c86c2fefd19f /pysnmp/cache.py
parent9815736980981682ec7c4d510cf0bd8e4473a3fe (diff)
downloadpysnmp-git-1244961c3fb0c76289bc94c6b66da7474838c556.tar.gz
all SNMP counters now incremented via '+= 1' rather than 'x = x + 1'
Diffstat (limited to 'pysnmp/cache.py')
-rw-r--r--pysnmp/cache.py4
1 files changed, 2 insertions, 2 deletions
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