Skip to content

Commit

Permalink
Remove an extra use of map
Browse files Browse the repository at this point in the history
  • Loading branch information
joroKr21 committed Sep 15, 2022
1 parent 23e7ce3 commit 5646fdd
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,10 @@ private[shapeless3] final class ErasedProductInstancesN[K, FT](val mirror: Mirro
val n = is.length
def step(xs: Vector[Any]) =
val i = xs.length
if i >= n then pure(Right(xs))
if i >= n then pure(Right(fromIndexedSeq(xs): Any))
else map(f(is(i)), a => Left(xs :+ a))

if n == 0 then pure(fromEmptyProduct)
else map(tailRecM(Vector.empty[Any], step), fromIndexedSeq)
else tailRecM(Vector.empty, step)
end erasedConstructM

final def erasedUnfold(a: Any)(f: (Any, Any) => (Any, Option[Any])): (Any, Option[Any]) = {
Expand Down

0 comments on commit 5646fdd

Please sign in to comment.