You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by md...@apache.org on 2023/03/19 15:24:06 UTC
[incubator-pekko] branch main updated: Add filterKeys for Scala 2.12 collection compat
This is an automated email from the ASF dual-hosted git repository.
mdedetrich pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko.git
The following commit(s) were added to refs/heads/main by this push:
new 44d03df694 Add filterKeys for Scala 2.12 collection compat
44d03df694 is described below
commit 44d03df694ec4057792bf94b3e4c1da13fcfa61f
Author: Matthew de Detrich <ma...@aiven.io>
AuthorDate: Sun Mar 19 14:34:35 2023 +0100
Add filterKeys for Scala 2.12 collection compat
---
actor/src/main/scala-2.12/org/apache/pekko/util/ccompat/package.scala | 3 +++
1 file changed, 3 insertions(+)
diff --git a/actor/src/main/scala-2.12/org/apache/pekko/util/ccompat/package.scala b/actor/src/main/scala-2.12/org/apache/pekko/util/ccompat/package.scala
index 823814d60e..414a52e9b9 100644
--- a/actor/src/main/scala-2.12/org/apache/pekko/util/ccompat/package.scala
+++ b/actor/src/main/scala-2.12/org/apache/pekko/util/ccompat/package.scala
@@ -110,4 +110,7 @@ class MapViewExtensionMethods[K, V, C <: scala.collection.Map[K, V]](
private val self: IterableView[(K, V), C]) extends AnyVal {
def mapValues[W, That](f: V => W)(implicit bf: CanBuildFrom[IterableView[(K, V), C], (K, W), That]): That =
self.map[(K, W), That] { case (k, v) => (k, f(v)) }
+
+ def filterKeys(p: K => Boolean): IterableView[(K, V), C] =
+ self.filter { case (k, _) => p(k) }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org