diff options
author | elie <elie> | 2015-12-12 15:48:47 +0000 |
---|---|---|
committer | elie <elie> | 2015-12-12 15:48:47 +0000 |
commit | 1244961c3fb0c76289bc94c6b66da7474838c556 (patch) | |
tree | 59c463ef9cb75b7c1a3a4c3681b4c86c2fefd19f /pysnmp/cache.py | |
parent | 9815736980981682ec7c4d510cf0bd8e4473a3fe (diff) | |
download | pysnmp-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.py | 4 |
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 |