8299199: Avoid redundant split calls in FontConfiguration.initReorderMap implementations

Reviewed-by: aivanov
This commit is contained in:
Andrey Turbanov 2022-12-22 19:09:37 +00:00
parent 62a033ecd7
commit b378381a9c
3 changed files with 2 additions and 9 deletions

View File

@ -852,11 +852,6 @@ public abstract class FontConfiguration {
return parts; 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// // Methods for extracting information from the fontconfig data for AWT//
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

View File

@ -74,8 +74,7 @@ public class MFontConfiguration extends FontConfiguration {
reorderMap.put("UTF-8.zh.TW", "chinese-tw-iso10646"); reorderMap.put("UTF-8.zh.TW", "chinese-tw-iso10646");
reorderMap.put("UTF-8.zh.HK", "chinese-tw-iso10646"); reorderMap.put("UTF-8.zh.HK", "chinese-tw-iso10646");
reorderMap.put("UTF-8.zh.CN", "chinese-cn-iso10646"); reorderMap.put("UTF-8.zh.CN", "chinese-cn-iso10646");
reorderMap.put("x-euc-jp-linux", reorderMap.put("x-euc-jp-linux", new String[] {"japanese-x0201", "japanese-x0208"});
split("japanese-x0201,japanese-x0208"));
reorderMap.put("GB2312", "chinese-gb18030"); reorderMap.put("GB2312", "chinese-gb18030");
reorderMap.put("Big5", "chinese-big5"); reorderMap.put("Big5", "chinese-big5");
reorderMap.put("EUC-KR", "korean"); reorderMap.put("EUC-KR", "korean");

View File

@ -79,8 +79,7 @@ public final class WFontConfiguration extends FontConfiguration {
reorderMap.put("GBK", "chinese-ms936"); reorderMap.put("GBK", "chinese-ms936");
reorderMap.put("GB18030", "chinese-gb18030"); reorderMap.put("GB18030", "chinese-gb18030");
reorderMap.put("x-windows-950", "chinese-ms950"); reorderMap.put("x-windows-950", "chinese-ms950");
reorderMap.put("x-MS950-HKSCS", split("chinese-ms950,chinese-hkscs")); reorderMap.put("x-MS950-HKSCS", new String[] {"chinese-ms950", "chinese-hkscs"});
// reorderMap.put("windows-1252", "alphabetic");
} }
@Override @Override