diff options
author | Raymond Hettinger <python@rcn.com> | 2010-04-11 20:41:56 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-04-11 20:41:56 (GMT) |
commit | fc3c9cd7939fe12e8298c2dd854b6e50e9353283 (patch) | |
tree | 7b6ccd4da8fd5ce42d7141423296bcab1ffe20bc /Lib/collections.py | |
parent | 6108ea8dad64ad94ba9d1bf7497af3d501f4935d (diff) | |
download | cpython-fc3c9cd7939fe12e8298c2dd854b6e50e9353283.zip cpython-fc3c9cd7939fe12e8298c2dd854b6e50e9353283.tar.gz cpython-fc3c9cd7939fe12e8298c2dd854b6e50e9353283.tar.bz2 |
Minor factoring
Diffstat (limited to 'Lib/collections.py')
-rw-r--r-- | Lib/collections.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/collections.py b/Lib/collections.py index 53e78f9..d6e8cb9 100644 --- a/Lib/collections.py +++ b/Lib/collections.py @@ -453,12 +453,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: |