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] [Updated] (AVRO-2692) Do Not Access Map Twice in
LogicalTypes
[ https://issues.apache.org/jira/browse/AVRO-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Mollitor updated AVRO-2692:
---------------------------------
Summary: Do Not Access Map Twice in LogicalTypes (was: Do Not Access Map Twice in Logical Types)
> Do Not Access Map Twice in LogicalTypes
> ---------------------------------------
>
> Key: AVRO-2692
> URL: https://issues.apache.org/jira/browse/AVRO-2692
> Project: Apache Avro
> Issue Type: Improvement
> Reporter: David Mollitor
> Assignee: David Mollitor
> Priority: Minor
>
> 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)