Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2692

Do Not Access Map Twice in LogicalTypes

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.10.0
    • Component/s: None
    • Labels:
      None

      Description

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

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

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                belugabehr David Mollitor
                Reporter:
                belugabehr David Mollitor
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: