Skip to content

Commit efd7ac1

Browse files
committed
Remove unnecessary function
1 parent 729567d commit efd7ac1

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

coloraide/average.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ class Sentinel(float):
1313
"""Sentinel object that is specific to averaging that we shouldn't see defined anywhere else."""
1414

1515

16-
def _iter_colors(colors: Iterable[ColorInput]) -> Iterable[tuple[ColorInput, float]]:
17-
"""Iterate colors and return weights."""
18-
19-
for c in colors:
20-
yield c, 1.0
21-
22-
2316
def average(
2417
color_cls: type[AnyColor],
2518
colors: Iterable[ColorInput],
@@ -66,7 +59,8 @@ def average(
6659

6760
# Sum channel values using a rolling average. Apply premultiplication and additional weighting as required.
6861
count = 0
69-
for c, w in (_iter_colors(colors) if no_weights else it.zip_longest(colors, weights, fillvalue=sentinel)): # type: ignore[arg-type]
62+
fill = 1 if no_weights else sentinel
63+
for c, w in it.zip_longest(colors, [] if no_weights else weights, fillvalue=fill): # type: ignore[arg-type]
7064

7165
# Handle explicit weighted cases
7266
if not no_weights:

0 commit comments

Comments
 (0)