You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2020/02/24 16:54:27 UTC

[GitHub] [openwhisk] rabbah commented on a change in pull request #4833: Force filterKeys and mapValues to return a Map.

rabbah commented on a change in pull request #4833: Force filterKeys and mapValues to return a Map.
URL: https://github.com/apache/openwhisk/pull/4833#discussion_r383387263
 
 

 ##########
 File path: common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskPackage.scala
 ##########
 @@ -122,14 +122,8 @@ case class WhiskPackage(namespace: EntityPath,
    * for this check.
    */
   def withPackageActions(actions: List[WhiskPackageAction] = List.empty): WhiskPackageWithActions = {
-    val actionGroups = actions map { a =>
-      //  group into "actions" and "feeds"
-      val feed = a.annotations.get(Parameters.Feed) map { _ =>
-        true
-      } getOrElse false
-      (feed, a)
-    } groupBy { _._1 } mapValues { _.map(_._2) }
-    WhiskPackageWithActions(this, actionGroups.getOrElse(false, List.empty), actionGroups.getOrElse(true, List.empty))
+    val (feedActions, nonFeedActions) = actions.partition(_.annotations.get(Parameters.Feed).isDefined)
 
 Review comment:
   there's a test for that i hope :D looks pretty/good to me

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services