dianfu commented on a change in pull request #18280:
URL: https://github.com/apache/flink/pull/18280#discussion_r779336639



##########
File path: flink-python/pyflink/datastream/data_stream.py
##########
@@ -1436,10 +1436,12 @@ def close(self):
                     self._close_func()
 
                 def process_element1(self, value, ctx: 
'KeyedCoProcessFunction.Context'):
-                    yield self._map1_func(value)
+                    if self._map1_func(value):
+                        yield self._map1_func(value)

Review comment:
       _map1_func is executed twice. It could be optimized as following:
   ```
   result = self._map1_func(value)
   if result is not None:
       yield result
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to