markusthoemmes commented on a change in pull request #4421: Turn method
'remove' into tail recursive
URL:
https://github.com/apache/incubator-openwhisk/pull/4421#discussion_r271144435
##########
File path:
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerPool.scala
##########
@@ -375,7 +377,8 @@ object ContainerPool {
* @param memory the amount of memory that has to be freed up
* @return a list of containers to be removed iff found
*/
- protected[containerpool] def remove[A](pool: Map[A, ContainerData], memory:
ByteSize): List[A] = {
+ @tailrec
+ protected[containerpool] def remove[A](pool: Map[A, ContainerData], memory:
ByteSize,toRemove :List[A] = List.empty): List[A] = {
Review comment:
You'll need to format this with scalafmt to pass CI.
----------------------------------------------------------------
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]
With regards,
Apache Git Services