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

Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • None
    • client-libs

                  int index = invalidComponents.indexOf(component);
                  if(index != -1) {
                      invalidComponents.remove(index);
                  }

      No need to call List.indexOf(Object) before List.remove(int). Instead we can call List.remove(Object) directly. It's faster and cleaner.
      invalidComponents is an ArrayList.

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

              Created:
              Updated: