Skip to content

Commit b378381

Browse files
author
Andrey Turbanov
committedDec 22, 2022
8299199: Avoid redundant split calls in FontConfiguration.initReorderMap implementations
Reviewed-by: aivanov
1 parent 62a033e commit b378381

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed
 

‎src/java.desktop/share/classes/sun/awt/FontConfiguration.java

-5
Original file line numberDiff line numberDiff line change
@@ -852,11 +852,6 @@ private static Vector<String> splitSequence(String sequence) {
852852
return parts;
853853
}
854854

855-
protected String[] split(String sequence) {
856-
Vector<String> v = splitSequence(sequence);
857-
return v.toArray(new String[0]);
858-
}
859-
860855
////////////////////////////////////////////////////////////////////////
861856
// Methods for extracting information from the fontconfig data for AWT//
862857
////////////////////////////////////////////////////////////////////////

‎src/java.desktop/unix/classes/sun/font/MFontConfiguration.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ protected void initReorderMap() {
7474
reorderMap.put("UTF-8.zh.TW", "chinese-tw-iso10646");
7575
reorderMap.put("UTF-8.zh.HK", "chinese-tw-iso10646");
7676
reorderMap.put("UTF-8.zh.CN", "chinese-cn-iso10646");
77-
reorderMap.put("x-euc-jp-linux",
78-
split("japanese-x0201,japanese-x0208"));
77+
reorderMap.put("x-euc-jp-linux", new String[] {"japanese-x0201", "japanese-x0208"});
7978
reorderMap.put("GB2312", "chinese-gb18030");
8079
reorderMap.put("Big5", "chinese-big5");
8180
reorderMap.put("EUC-KR", "korean");

‎src/java.desktop/windows/classes/sun/awt/windows/WFontConfiguration.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ protected void initReorderMap() {
7979
reorderMap.put("GBK", "chinese-ms936");
8080
reorderMap.put("GB18030", "chinese-gb18030");
8181
reorderMap.put("x-windows-950", "chinese-ms950");
82-
reorderMap.put("x-MS950-HKSCS", split("chinese-ms950,chinese-hkscs"));
83-
// reorderMap.put("windows-1252", "alphabetic");
82+
reorderMap.put("x-MS950-HKSCS", new String[] {"chinese-ms950", "chinese-hkscs"});
8483
}
8584

8685
@Override

0 commit comments

Comments
 (0)
Please sign in to comment.