Skip to content

Commit

Permalink
Optimize mapAccumulateFilter for Queue
Browse files Browse the repository at this point in the history
  • Loading branch information
Masynchin committed Feb 19, 2024
1 parent 15ec803 commit 9adf4d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/main/scala/cats/instances/queue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,8 @@ private object QueueInstances {
G.map2Eval(f(x), xse)((b, queue) => if (b) x +: queue else queue)
)
.value

override def mapAccumulateFilter[S, A, B](init: S, fa: Queue[A])(f: (S, A) => (S, Option[B])): (S, Queue[B]) =
StaticMethods.mapAccumulateFilterFromStrictFunctorFilter(init, fa, f)(this)
}
}

0 comments on commit 9adf4d5

Please sign in to comment.