mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8241649: Optimize Character.toString
Reviewed-by: redestad, rriggs
This commit is contained in:
parent
b8f8dea9c2
commit
b35032dc01
1 changed files with 3 additions and 4 deletions
|
@ -3285,7 +3285,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
|
||||||
"SYMBOLS AND PICTOGRAPHS EXTENDED-A",
|
"SYMBOLS AND PICTOGRAPHS EXTENDED-A",
|
||||||
"SYMBOLSANDPICTOGRAPHSEXTENDED-A");
|
"SYMBOLSANDPICTOGRAPHSEXTENDED-A");
|
||||||
|
|
||||||
private static final int blockStarts[] = {
|
private static final int[] blockStarts = {
|
||||||
0x0000, // 0000..007F; Basic Latin
|
0x0000, // 0000..007F; Basic Latin
|
||||||
0x0080, // 0080..00FF; Latin-1 Supplement
|
0x0080, // 0080..00FF; Latin-1 Supplement
|
||||||
0x0100, // 0100..017F; Latin Extended-A
|
0x0100, // 0100..017F; Latin Extended-A
|
||||||
|
@ -8068,7 +8068,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
|
||||||
UNKNOWN, // E01F0..10FFFF
|
UNKNOWN, // E01F0..10FFFF
|
||||||
};
|
};
|
||||||
|
|
||||||
private static HashMap<String, Character.UnicodeScript> aliases;
|
private static final HashMap<String, Character.UnicodeScript> aliases;
|
||||||
static {
|
static {
|
||||||
aliases = new HashMap<>((int)(153 / 0.75f + 1.0f));
|
aliases = new HashMap<>((int)(153 / 0.75f + 1.0f));
|
||||||
aliases.put("ADLM", ADLAM);
|
aliases.put("ADLM", ADLAM);
|
||||||
|
@ -8421,8 +8421,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
|
||||||
* @return a string representation of this object.
|
* @return a string representation of this object.
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
char buf[] = {value};
|
return String.valueOf(value);
|
||||||
return String.valueOf(buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue