rabbah 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_r170953953
 
 

 ##########
 File path: 
core/invoker/src/main/scala/whisk/core/containerpool/ContainerProxy.scala
 ##########
 @@ -429,7 +429,7 @@ object ContainerProxy {
    * @return a unique container name
    */
   def containerName(instance: InstanceId, prefix: String, suffix: String) =
-    
s"wsk${instance.toInt}_${containerCount.next()}_${prefix}_${suffix}".replaceAll("[^a-zA-Z0-9_]",
 "")
+    
s"wsk${instance.toInt}_${containerCount.next()}_${prefix.filter(_.isLetterOrDigit)}_${suffix.filter(_.isLetterOrDigit)}"
 
 Review comment:
   dropping the `_` on the suffix is harmless.

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


With regards,
Apache Git Services

Reply via email to