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

Avoid unnecessary array fill after creation in PaletteBuilder

XMLWordPrintable

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

      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.

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

              Created:
              Updated:
              Resolved: