mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Minor factoring
This commit is contained in:
parent
6108ea8dad
commit
fc3c9cd793
1 changed files with 1 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue