Skip to content

Commit

Permalink
8299199: Avoid redundant split calls in FontConfiguration.initReorder…
Browse files Browse the repository at this point in the history
…Map implementations

Reviewed-by: aivanov
  • Loading branch information
Andrey Turbanov committed Dec 22, 2022
1 parent 62a033e commit b378381
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
5 changes: 0 additions & 5 deletions src/java.desktop/share/classes/sun/awt/FontConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -852,11 +852,6 @@ private static Vector<String> splitSequence(String sequence) {
return parts;
}

protected String[] split(String sequence) {
Vector<String> v = splitSequence(sequence);
return v.toArray(new String[0]);
}

////////////////////////////////////////////////////////////////////////
// Methods for extracting information from the fontconfig data for AWT//
////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ protected void initReorderMap() {
reorderMap.put("UTF-8.zh.TW", "chinese-tw-iso10646");
reorderMap.put("UTF-8.zh.HK", "chinese-tw-iso10646");
reorderMap.put("UTF-8.zh.CN", "chinese-cn-iso10646");
reorderMap.put("x-euc-jp-linux",
split("japanese-x0201,japanese-x0208"));
reorderMap.put("x-euc-jp-linux", new String[] {"japanese-x0201", "japanese-x0208"});
reorderMap.put("GB2312", "chinese-gb18030");
reorderMap.put("Big5", "chinese-big5");
reorderMap.put("EUC-KR", "korean");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ protected void initReorderMap() {
reorderMap.put("GBK", "chinese-ms936");
reorderMap.put("GB18030", "chinese-gb18030");
reorderMap.put("x-windows-950", "chinese-ms950");
reorderMap.put("x-MS950-HKSCS", split("chinese-ms950,chinese-hkscs"));
// reorderMap.put("windows-1252", "alphabetic");
reorderMap.put("x-MS950-HKSCS", new String[] {"chinese-ms950", "chinese-hkscs"});
}

@Override
Expand Down

1 comment on commit b378381

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.