style95 commented on a change in pull request #4940:
URL: https://github.com/apache/openwhisk/pull/4940#discussion_r472016173



##########
File path: 
core/controller/src/main/scala/org/apache/openwhisk/core/controller/Actions.scala
##########
@@ -537,6 +537,14 @@ trait WhiskActionsApi extends WhiskCollectionAPI with 
PostActionActivation with
 
     val exec = content.exec getOrElse action.exec
 
+    var newAnnotations = action.annotations

Review comment:
       I think we would not want to use the `var` variable.
   
   Since the main target here is to remove items from `action.annotations` 
which are in the `content.delAnnotations`, I think we can do something similar 
to this:
   
   ```suggestion
       val newAnnotations = content.delAnnotations.map { annotationArray =>
         annotationArray.foldRight(action.annotations)((a: String, b: 
Parameters) => b - a)
       }.map( _ ++ content.annotations).getOrElse(action.annotations ++ 
content.annotations)
   ```
   




----------------------------------------------------------------
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:
[email protected]


Reply via email to