Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-472

wasted work in AbstractMapBag.containsAll()

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.1
    • 4.0-alpha1, 4.0
    • Bag
    • any

    Description

      The problem appears in version 3.2.1 and in revision 1489197. I
      attached a one-line patch that fixes it.

      In method "AbstractMapBag.containsAll", the loop over
      "other.uniqueSet()" should return immediately after "result" becomes
      "false", because "result = result && contains;" can never become
      "true" again. All the iterations after "result" becomes "false" do
      not perform any useful work, at best they just set "result" again to
      "false".

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            adriannistor Adrian Nistor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment