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

Optimize Observable{List/Set/Map}Wrapper.retainAll/removeAll

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • jfx21
    • jfx17
    • javafx
    • None
    • b12

      Observable{List/Set/Map}Wrapper.retainAll/removeAll can be optimized for some edge cases.

      removeAll(c):
      This is a no-op if 'c' is empty.

      retainAll(c):
      This is a no-op if the backing collection is empty, or equivalent to `clear` if 'c' is empty.

      The implementation should be improved to detect these situations and skip potentially expensive operations like an enumeration of the backing collection (in the case of no-ops).

            mstrauss Michael Strauß
            mstrauss Michael Strauß
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: