QLocale: Merge month name data storage to save 50KB memory
Month Names and Standalone Month Names are stored separately, but for majority of locales the names are the same and so storage is duplicated. By storing both sets of names in the same array 50KB is saved in libQtCore.so on Linux. Depends on change Ic84bbc82 in branch api_review for CLDR 1.9.1 Change-Id: I83224ebc2180ee6de69797fa50d38348acc94107 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>bb10
parent
33984e72ab
commit
ab3837f86f
|
|
@ -1954,7 +1954,7 @@ QString QLocale::standaloneMonthName(int month, FormatType type) const
|
|||
default:
|
||||
return QString();
|
||||
}
|
||||
QString name = getLocaleListData(standalone_months_data + idx, size, month - 1);
|
||||
QString name = getLocaleListData(months_data + idx, size, month - 1);
|
||||
if (name.isEmpty())
|
||||
return monthName(month, type);
|
||||
return name;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -504,7 +504,6 @@ def main():
|
|||
date_format_data = StringData()
|
||||
time_format_data = StringData()
|
||||
months_data = StringData()
|
||||
standalone_months_data = StringData()
|
||||
days_data = StringData()
|
||||
am_data = StringData()
|
||||
pm_data = StringData()
|
||||
|
|
@ -546,9 +545,9 @@ def main():
|
|||
date_format_data.append(l.longDateFormat),
|
||||
time_format_data.append(l.shortTimeFormat),
|
||||
time_format_data.append(l.longTimeFormat),
|
||||
standalone_months_data.append(l.standaloneShortMonths),
|
||||
standalone_months_data.append(l.standaloneLongMonths),
|
||||
standalone_months_data.append(l.standaloneNarrowMonths),
|
||||
months_data.append(l.standaloneShortMonths),
|
||||
months_data.append(l.standaloneLongMonths),
|
||||
months_data.append(l.standaloneNarrowMonths),
|
||||
months_data.append(l.shortMonths),
|
||||
months_data.append(l.longMonths),
|
||||
months_data.append(l.narrowMonths),
|
||||
|
|
@ -612,14 +611,6 @@ def main():
|
|||
|
||||
data_temp_file.write("\n")
|
||||
|
||||
# Standalone months data
|
||||
#check_static_char_array_length("standalone_months", standalone_months_data.data)
|
||||
data_temp_file.write("static const ushort standalone_months_data[] = {\n")
|
||||
data_temp_file.write(wrap_list(standalone_months_data.data))
|
||||
data_temp_file.write("\n};\n")
|
||||
|
||||
data_temp_file.write("\n")
|
||||
|
||||
# Days data
|
||||
#check_static_char_array_length("days", days_data.data)
|
||||
data_temp_file.write("static const ushort days_data[] = {\n")
|
||||
|
|
|
|||
Loading…
Reference in New Issue