Avoid unnecessary array fill after creation in PaletteBuilder

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 21
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: