[ 
https://issues.apache.org/jira/browse/PARQUET-1723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17006782#comment-17006782
 ] 

ASF GitHub Bot commented on PARQUET-1723:
-----------------------------------------

Fokko commented on pull request #711: PARQUET-1723: Read From Maps Without 
Using Contains
URL: https://github.com/apache/parquet-mr/pull/711
 
 
   
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Read From Maps Without Using Contains
> -------------------------------------
>
>                 Key: PARQUET-1723
>                 URL: https://issues.apache.org/jira/browse/PARQUET-1723
>             Project: Parquet
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Minor
>              Labels: pull-request-available
>
> I see a few places with the following pattern...
>  
> {code:java}
> if (map.contains(key)) {
>    return map.get(key);
> }
> {code}
> Better to just call {{get()}} and then check the return value for 'null' to 
> determine if the key is there.  This prevents the need to traverse the 
> {{Map}} twice,... once for {{contains}} and once for {{get}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to