You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "David Mollitor (Jira)" <ji...@apache.org> on 2020/01/17 16:09:00 UTC

[jira] [Created] (AVRO-2692) Do Not Access Map Twice in Logical Types

David Mollitor created AVRO-2692:
------------------------------------

             Summary: Do Not Access Map Twice in Logical Types
                 Key: AVRO-2692
                 URL: https://issues.apache.org/jira/browse/AVRO-2692
             Project: Apache Avro
          Issue Type: Improvement
            Reporter: David Mollitor
            Assignee: David Mollitor


https://github.com/apache/avro/blob/84b056c2adc069cf31f3b4d3c9337cb7cdaa58d6/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java#L102-L107

{code:java|title=LogicalTypes.java}
        final LogicalTypeFactory typeFactory = REGISTERED_TYPES.get(typeName);
        if (typeFactory != null) {
          logicalType = REGISTERED_TYPES.get(typeName).fromSchema(schema);
        } else {
          logicalType = null;
        }
{code}

The {{typeFactory}} is already obtained from the map on the first line, no need to go back to the map again to {{get}} it.



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