mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 23:56:06 +00:00
LibJS: Replace String const& with StringView in various Temporal AOs
This is especially helpful where we already pass StringView literals and only compare them with others, e.g. overflow and largest/smallest unit, in which case there's no need to actually allocate a string.
This commit is contained in:
parent
9c3da7a3e3
commit
81aaa9ccd5
Notes:
sideshowbarker
2024-07-18 04:25:03 +09:00
Author: https://github.com/linusg
Commit: 81aaa9ccd5
Pull-request: https://github.com/SerenityOS/serenity/pull/9903
Reviewed-by: https://github.com/IdanHo ✅
11 changed files with 23 additions and 23 deletions
|
@ -162,7 +162,7 @@ PlainDate* to_temporal_date(GlobalObject& global_object, Value item, Object* opt
|
|||
}
|
||||
|
||||
// 3.5.4 RegulateISODate ( year, month, day, overflow ), https://tc39.es/proposal-temporal/#sec-temporal-regulateisodate
|
||||
Optional<ISODate> regulate_iso_date(GlobalObject& global_object, double year, double month, double day, String const& overflow)
|
||||
Optional<ISODate> regulate_iso_date(GlobalObject& global_object, double year, double month, double day, StringView overflow)
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
// 1. Assert: year, month, and day are integers.
|
||||
|
@ -380,7 +380,7 @@ Optional<String> temporal_date_to_string(GlobalObject& global_object, PlainDate&
|
|||
}
|
||||
|
||||
// 3.5.9 AddISODate ( year, month, day, years, months, weeks, days, overflow ), https://tc39.es/proposal-temporal/#sec-temporal-addisodate
|
||||
Optional<ISODate> add_iso_date(GlobalObject& global_object, i32 year, u8 month, u8 day, double years, double months, double weeks, double days, String const& overflow)
|
||||
Optional<ISODate> add_iso_date(GlobalObject& global_object, i32 year, u8 month, u8 day, double years, double months, double weeks, double days, StringView overflow)
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue