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

Improve Character.isLowerCase/isUpperCase lookups

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • None
    • 17
    • core-libs
    • None
    • b14

    Description

      Character.isLowerCase/isUpperCase returns true for some non-letter characters, which means the logic currently checks the type generic type. If it matches (Character.UPPERCASE_LETTER/LOWERCASE_LETTER) we return true, otherwise we check the "Other_Uppercase"/"Other_Lowercase" Unicode property that is currently encoded into the B[] table. This means more code and an extra branch.

      By recording the combined uppercase / lowercase properties into a single bit each, we could optimize the logic to a single table lookup.

      Attachments

        Issue Links

          Activity

            People

              redestad Claes Redestad
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: