Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8300731

Avoid unnecessary array fill after creation in PaletteBuilder

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P5
    • 21
    • None
    • client-libs

    Description

      In the method 'com.sun.imageio.plugins.common.PaletteBuilder#buildPalette' a new array is created and then immediately filled with 'null'

              reduceList = new ColorNode[MAXLEVEL + 1];
              for (int i = 0; i < reduceList.length; i++) {
                  reduceList[i] = null;
              }

      It's redundant. Java guarantees that all elements of array are nulls anyway.

      Attachments

        Issue Links

          Activity

            People

              aturbanov Andrey Turbanov
              aturbanov Andrey Turbanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: