From a414be1370d084816f5dcd33aef36e56c8ee431f Mon Sep 17 00:00:00 2001 From: Max Smirnov Date: Mon, 19 Feb 2024 22:38:07 +0300 Subject: [PATCH] Optimize mapAccumulateFilter for ArraySeq --- core/src/main/scala-2.13+/cats/instances/arraySeq.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/scala-2.13+/cats/instances/arraySeq.scala b/core/src/main/scala-2.13+/cats/instances/arraySeq.scala index 355664b0be..7a185ee089 100644 --- a/core/src/main/scala-2.13+/cats/instances/arraySeq.scala +++ b/core/src/main/scala-2.13+/cats/instances/arraySeq.scala @@ -222,5 +222,8 @@ private[cats] object ArraySeqInstances { fa.foldRight(Eval.now(G.pure(ArraySeq.untagged.empty[A]))) { case (x, xse) => G.map2Eval(f(x), xse)((b, vec) => if (b) x +: vec else vec) }.value + + override def mapAccumulateFilter[S, A, B](init: S, fa: ArraySeq[A])(f: (S, A) => (S, Option[B])): (S, ArraySeq[B]) = + StaticMethods.mapAccumulateFilterFromStrictFunctorFilter(init, fa, f)(this) } }