Skip to content
Permalink
Browse files

8241649: Optimize Character.toString

Reviewed-by: redestad, rriggs
  • Loading branch information
stsypanov authored and cl4es committed Mar 26, 2020
1 parent b8f8dea commit b35032dc0181925cd46aa98f4e9fe6b6e5ab0cb7
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/java.base/share/classes/java/lang/Character.java
@@ -3285,7 +3285,7 @@ private UnicodeBlock(String idName, String... aliases) {
"SYMBOLS AND PICTOGRAPHS EXTENDED-A",
"SYMBOLSANDPICTOGRAPHSEXTENDED-A");

private static final int blockStarts[] = {
private static final int[] blockStarts = {
0x0000, // 0000..007F; Basic Latin
0x0080, // 0080..00FF; Latin-1 Supplement
0x0100, // 0100..017F; Latin Extended-A
@@ -8068,7 +8068,7 @@ public static final UnicodeBlock forName(String blockName) {
UNKNOWN, // E01F0..10FFFF
};

private static HashMap<String, Character.UnicodeScript> aliases;
private static final HashMap<String, Character.UnicodeScript> aliases;
static {
aliases = new HashMap<>((int)(153 / 0.75f + 1.0f));
aliases.put("ADLM", ADLAM);
@@ -8421,8 +8421,7 @@ public boolean equals(Object obj) {
* @return a string representation of this object.
*/
public String toString() {
char buf[] = {value};
return String.valueOf(buf);
return String.valueOf(value);
}

/**

0 comments on commit b35032d

Please sign in to comment.