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

Do Not Access Map Twice in LogicalTypes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.10.0
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: