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

Remove unnecessary List.indexOf key from Track.remove

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 26
    • 8, 11, 17, 21, 24, 25, 26
    • client-libs

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

                      int i = eventsList.indexOf(event);
                      if (i >= 0) {
                          eventsList.remove(i);
                          return true;
                      }

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

              Created:
              Updated:
              Resolved: