You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/12/29 06:15:19 UTC

[GitHub] [incubator-eventmesh] Alonexc opened a new issue, #2722: [Enhancement] Method run() uses integer based for loops to iterate over a List

Alonexc opened a new issue, #2722:
URL: https://github.com/apache/incubator-eventmesh/issues/2722

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Enhancement Request
   
   ![image](https://user-images.githubusercontent.com/91315508/209910644-0ac66ef0-fcd6-4b74-bbb2-c45065432e51.png)
   located at:
   eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/tcp/client/task/SubscribeTask.java line 60
   analysis and explanation:
   This method uses an integer-based for loop to iterate over a java.util.List, by calling List.get(i) each time through the loop. The integer is not used for other reasons. It is better to use an Iterator instead, as depending on List implementation, iterators can perform better, and they also allow for exchanging of other collection types without issue.
   
   
   ### Describe the solution you'd like
   
   Use foreach or iterator.
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


-- 
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: dev-unsubscribe@eventmesh.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] jonyangx commented on issue #2722: [Enhancement] Method run() uses integer based for loops to iterate over a List

Posted by GitBox <gi...@apache.org>.
jonyangx commented on issue #2722:
URL: https://github.com/apache/incubator-eventmesh/issues/2722#issuecomment-1368141891

   I'd like to fix it.


-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] xwm1992 closed issue #2722: [Enhancement] Method run() uses integer based for loops to iterate over a List

Posted by GitBox <gi...@apache.org>.
xwm1992 closed issue #2722: [Enhancement] Method run() uses integer based for loops to iterate over a List
URL: https://github.com/apache/incubator-eventmesh/issues/2722


-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org