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/14 08:34:29 UTC

[GitHub] [incubator-eventmesh] Alonexc opened a new issue, #2597: [Enhancement] Method checks for an item in a set with contains, before using add()

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

   ### 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/207544014-1006674d-ce52-420f-b2a3-ebacdae8e40c.png)
   located at:
   eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/consumer/HttpClientGroupMapping.java line 224
   analysis and explanation:
   This method checks to see if an element is not in a set before adding it. This is unnecessary as you can just add the item, and if the item exists, it won't add it, otherwise it will.
   
   
   ### Describe the solution you'd like
   
   As an example, instead of using 
                   Set  mySet = getSomeSet();
                   if (!mySet.contains("foo")) {
                       mySet.add("foo");
                   }   
   convert this to 
                   Set  mySet = getSomeSet();
                   if (mySet.add("foo")) {
                   }
   
   
   ### 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] xwm1992 closed issue #2597: [Enhancement] Method checks for an item in a set with contains, before using add()

Posted by GitBox <gi...@apache.org>.
xwm1992 closed issue #2597: [Enhancement] Method checks for an item in a set with contains, before using add()
URL: https://github.com/apache/incubator-eventmesh/issues/2597


-- 
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] jonyangx commented on issue #2597: [Enhancement] Method checks for an item in a set with contains, before using add()

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

   I want 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