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/10/12 01:39:34 UTC

[GitHub] [incubator-eventmesh] Alonexc opened a new issue, #1526: [Enhancement] Method check a map with containsKey(), before using get() [SimpleMessage]

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

   ### 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/195228332-05940976-355e-4600-a9b4-bb9c77360db0.png)
   located at: org/apache/eventmesh/common/protocol/grpc/protos/SimpleMessage.java line 499 and 1643
   This method checks for the presence of a key in a map using containsKey(), before attempting to fetch the value of the key using get(). This equates to doing two map lookups in a row.
   
   ### Describe the solution you'd like
   
    It is much simpler to just fetch the value with get, and checking for non null instead.
   eg:
                   Map  myMap = getSomeMap();
        	    	String value = myMap.get("foo");
       	    	if (value != null) {
       	    		....
       	    	}
   
   ### 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] venu-prasanna commented on issue #1526: [Enhancement] Method check a map with containsKey(), before using get() [SimpleMessage]

Posted by GitBox <gi...@apache.org>.
venu-prasanna commented on issue #1526:
URL: https://github.com/apache/incubator-eventmesh/issues/1526#issuecomment-1275838271

   Hello @Alonexc, 
   I am interested to contribute on this.


-- 
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] qqeasonchen closed issue #1526: [Enhancement] Method check a map with containsKey(), before using get() [SimpleMessage]

Posted by GitBox <gi...@apache.org>.
qqeasonchen closed issue #1526: [Enhancement] Method check a map with containsKey(), before using get() [SimpleMessage]
URL: https://github.com/apache/incubator-eventmesh/issues/1526


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