mirror of https://github.com/scrapy/scrapy.git
Avoid creation of temporary list object in iflatten
This commit is contained in:
parent
ea4199f8e1
commit
d9fddabe95
|
|
@ -38,7 +38,7 @@ def iflatten(x):
|
|||
Similar to ``.flatten()``, but returns iterator instead"""
|
||||
for el in x:
|
||||
if is_listlike(el):
|
||||
for el_ in flatten(el):
|
||||
for el_ in iflatten(el):
|
||||
yield el_
|
||||
else:
|
||||
yield el
|
||||
|
|
|
|||
Loading…
Reference in New Issue