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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • jfx21
    • Affects Version/s: jfx17
    • Component/s: 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).

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

              Created:
              Updated:
              Resolved: