Sped _update().
Uses the fast update() method when a dictionary is available.
This commit is contained in:
parent
fc26c0730c
commit
1a8d193121
|
@ -310,6 +310,15 @@ class BaseSet(object):
|
|||
def _update(self, iterable):
|
||||
# The main loop for update() and the subclass __init__() methods.
|
||||
data = self._data
|
||||
|
||||
# Use the fast update() method when a dictionary is available.
|
||||
if isinstance(iterable, BaseSet):
|
||||
data.update(iterable._data)
|
||||
return
|
||||
if isinstance(iterable, dict):
|
||||
data.update(iterable)
|
||||
return
|
||||
|
||||
value = True
|
||||
it = iter(iterable)
|
||||
while True:
|
||||
|
|
Loading…
Reference in New Issue