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

java.util.AbstractSet can speed up removeAll

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 1.3.0
    • Component/s: core-libs
    • Labels:

      Description



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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: