summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2010-04-11 20:39:28 +0000
committerRaymond Hettinger <python@rcn.com>2010-04-11 20:39:28 +0000
commitfdf1b5642ba6b9c98b312912c30abf73cbdd4844 (patch)
tree6a41be77ec59aaaa5c43fc474f8cc9886b341985
parenta185839862b044ae6fe866b396c7fce267401e78 (diff)
downloadcpython-git-fdf1b5642ba6b9c98b312912c30abf73cbdd4844.tar.gz
Minor factoring
-rw-r--r--Lib/collections.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/collections.py b/Lib/collections.py
index 9edc294ef0..20cc6003bc 100644
--- a/Lib/collections.py
+++ b/Lib/collections.py
@@ -452,12 +452,11 @@ class Counter(dict):
'''
if iterable is not None:
+ self_get = self.get
if isinstance(iterable, Mapping):
- self_get = self.get
for elem, count in iterable.items():
self[elem] = self_get(elem, 0) - count
else:
- self_get = self.get
for elem in iterable:
self[elem] = self_get(elem, 0) - 1
if kwds: