Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1243

Simplify ArrayUtils removeElements by using new decrementAndGet() method

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.4
    • 3.5
    • None
    • None

    Description

      As the subject says - the new decrementAndGet() method can be used to simplify the following sequence:

                      count.decrement();
                      if (count.intValue() == 0) {
      

      as follows

                      if (count.decrementAndGet() == 0) {
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: