mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 12:32:21 +00:00
LibLocale: Use String::from_utf8_without_validation() in generated code
The unnecessary UTF-8 validation performed here was actually visible while profiling navigation between pages on GitHub.
This commit is contained in:
parent
819f2c1df6
commit
1068518bdf
Notes:
sideshowbarker
2024-07-17 04:10:16 +09:00
Author: https://github.com/awesomekling
Commit: 1068518bdf
Pull-request: https://github.com/SerenityOS/serenity/pull/24058
Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 5 additions and 5 deletions
|
@ -1796,10 +1796,10 @@ struct CalendarPatternImpl {
|
|||
CalendarPattern to_unicode_calendar_pattern() const {
|
||||
CalendarPattern calendar_pattern {};
|
||||
|
||||
calendar_pattern.skeleton = MUST(String::from_utf8(decode_string(skeleton)));
|
||||
calendar_pattern.pattern = MUST(String::from_utf8(decode_string(pattern)));
|
||||
calendar_pattern.skeleton = String::from_utf8_without_validation(decode_string(skeleton).bytes());
|
||||
calendar_pattern.pattern = String::from_utf8_without_validation(decode_string(pattern).bytes());
|
||||
if (pattern12 != 0)
|
||||
calendar_pattern.pattern12 = MUST(String::from_utf8(decode_string(pattern12)));
|
||||
calendar_pattern.pattern12 = String::from_utf8_without_validation(decode_string(pattern12).bytes());
|
||||
|
||||
convert_calendar_fields(*this, calendar_pattern);
|
||||
return calendar_pattern;
|
||||
|
@ -1828,9 +1828,9 @@ struct CalendarRangePatternImpl {
|
|||
|
||||
if (field != -1)
|
||||
calendar_range_pattern.field = static_cast<CalendarRangePattern::Field>(field);
|
||||
calendar_range_pattern.start_range = MUST(String::from_utf8(decode_string(start_range)));
|
||||
calendar_range_pattern.start_range = String::from_utf8_without_validation(decode_string(start_range).bytes());
|
||||
calendar_range_pattern.separator = decode_string(separator);
|
||||
calendar_range_pattern.end_range = MUST(String::from_utf8(decode_string(end_range)));
|
||||
calendar_range_pattern.end_range = String::from_utf8_without_validation(decode_string(end_range).bytes());
|
||||
|
||||
convert_calendar_fields(*this, calendar_range_pattern);
|
||||
return calendar_range_pattern;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue