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

pico-optimize contains(Object) methods

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P3
    • 9
    • None
    • core-libs
    • b31
    • generic
    • generic

    Backports

      Description

        The idiom
        return index >= 0
        is one byte shorter than
        return index != -1
        for collection contains(Object) methods

        In the core libraries, even such small optimizations should not go undone, especially when it makes the core library source code more consistent.

        http://cr.openjdk.java.net/~martin/webrevs/openjdk9/pico-optimize-contains/

        Attachments

          Issue Links

            Activity

              People

                martin Martin Buchholz
                martin Martin Buchholz
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: