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

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

    XMLWordPrintable

Details

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

    Description

      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).

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: