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/11 09:37:38 UTC

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

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

   ### 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/195054121-ce7706f2-e2f2-4c04-b08b-591e640f2a5d.png)
   located at: org/apache/eventmesh/common/protocol/grpc/protos/BatchMessage.java line 1406
   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] qqeasonchen closed issue #1518: [Enhancement] Method check a map with containsKey(), before using get() [BatchMessage]

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


-- 
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] mroccyen commented on issue #1518: [Enhancement] Method check a map with containsKey(), before using get() [BatchMessage]

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

   i will try my best to do it,please assign to me


-- 
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] BrindhaEaswaramurthy commented on issue #1518: [Enhancement] Method check a map with containsKey(), before using get() [BatchMessage]

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

   I would like to work on this issue.can you please assign this to me


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