Github user kl0u commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3963#discussion_r117985885
  
    --- Diff: 
flink-libraries/flink-cep-scala/src/main/scala/org/apache/flink/cep/scala/package.scala
 ---
    @@ -40,7 +44,11 @@ package object scala {
     
       private[flink] def cleanClosure[F <: AnyRef](f: F, checkSerializable: 
Boolean = true): F = {
         ClosureCleaner.clean(f, checkSerializable)
    -    return f
    +    f
    +  }
    +
    +  private[flink] def mapToScala[T](map: JMap[String, JList[T]]): 
Map[String, Iterable[T]] = {
    +    map.asScala.mapValues(_.asScala.toIterable).toMap
    --- End diff --
    
    Why not getting rid of the last `.toMap` and return a `collection.Map`? 
This will avoid an iteration over the elements of the `JMap` which is important 
given that this method will be invoked at every incoming element. From the 
rest, I think we are ok as the `asScala`s are just wrappers and the 
`.mapValues` are lazily evaluated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to