You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by "David Mollitor (Jira)" <ji...@apache.org> on 2019/12/23 22:02:00 UTC

[jira] [Created] (PARQUET-1723) Read From Maps Without Using Contains

David Mollitor created PARQUET-1723:
---------------------------------------

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


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)