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

pico-optimize contains(Object) methods

XMLWordPrintable

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

        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/

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

                Created:
                Updated:
                Resolved: