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

pico-optimize contains(Object) methods

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b31
    • CPU:
      generic
    • OS:
      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

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

                  Dates

                  Created:
                  Updated:
                  Resolved: