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 2018/02/27 15:18:29 UTC

[GitHub] sven-lange-last commented on a change in pull request #3357: Remove usages of replace and replaceAll on the hotpath.

sven-lange-last commented on a change in pull request #3357: Remove usages of replace and replaceAll on the hotpath.
URL: https://github.com/apache/incubator-openwhisk/pull/3357#discussion_r170956585
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/entity/ActivationId.scala
 ##########
 @@ -42,7 +42,7 @@ import whisk.http.Messages
  */
 protected[whisk] class ActivationId private (private val id: java.util.UUID) extends AnyVal {
   def asString = toString
-  override def toString = id.toString.replaceAll("-", "")
+  override def toString = id.toString.filterNot(_ == '-')
 
 Review comment:
   For some reasons, we suspect that the `toString` and `asString` methods are run rather often. So it's probably no pre-mature optimisation to compute the filter upon construction and have a `val idString` that is returned instead of computing on the fly.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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