Skip to content

Commit 7c10fbd

Browse files
committed
Fast path when *initial* is specified
1 parent b1f5c1f commit 7c10fbd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

more_itertools/more.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2829,7 +2829,7 @@ def difference(iterable, func=sub, *, initial=None):
28292829
return iter([])
28302830

28312831
if initial is not None:
2832-
first = []
2832+
return map(func, b, a)
28332833

28342834
return chain(first, map(func, b, a))
28352835

0 commit comments

Comments
 (0)