8331264: Reduce java.lang.constant initialization overhead

Reviewed-by: liach, mchung
This commit is contained in:
Claes Redestad 2024-04-30 08:27:38 +00:00
parent 60b61e588c
commit 0630bb02eb
7 changed files with 69 additions and 67 deletions

View file

@ -270,7 +270,7 @@ public sealed interface ClassDesc
* @return whether this {@linkplain ClassDesc} describes an array type
*/
default boolean isArray() {
return descriptorString().startsWith("[");
return descriptorString().charAt(0) == '[';
}
/**
@ -288,7 +288,7 @@ public sealed interface ClassDesc
* @return whether this {@linkplain ClassDesc} describes a class or interface type
*/
default boolean isClassOrInterface() {
return descriptorString().startsWith("L");
return descriptorString().charAt(0) == 'L';
}
/**