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

java.util.AbstractSet can speed up removeAll

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.3.0
    • 1.2.2
    • core-libs



      Name: rlT66838 Date: 08/30/99


      This may be related to bug 4152868. I noticed that
      TreeSet.removeAll doesn't override this method
      inherited from AbstractCollection class. I made my
      application about 40% faster by extending TreeSet
      and overriding removeAll as follows:

      public boolean removeAll(Collection c)
      {
      boolean modified = false;
      Iterator i = c.iterator();
      while (i.hasNext())
      {
      modified = remove(i.next());
      }
      return modified;
      }

      This code takes advantage of RB tree structure
      used in the implementation.
      (Review ID: 94612)
      ======================================================================

            mmcclosksunw Michael Mccloskey (Inactive)
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: