diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-09-06 22:46:55 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-09-06 22:15:39 +0100 |
commit | 456938add04d200a1e025d2f4542f2dc5244641e (patch) | |
tree | cd93466d3bc6b7c3aaaa073e8b053ae84ce3f4ea /Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp | |
parent | 4b5aa2102cfae44643180c97d59483cafb57d02b (diff) | |
download | serenity-456938add04d200a1e025d2f4542f2dc5244641e.zip |
LibJS: Use StringViews in Round{NumberToIncrement, TemporalInstant}
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp index 9b8b530bb3..55af89dd1f 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp @@ -204,40 +204,40 @@ BigInt* difference_instant(GlobalObject& global_object, BigInt const& nanosecond } // 8.5.8 RoundTemporalInstant ( ns, increment, unit, roundingMode ), https://tc39.es/proposal-temporal/#sec-temporal-roundtemporalinstant -BigInt* round_temporal_instant(GlobalObject& global_object, BigInt const& nanoseconds, u64 increment, String const& unit, String const& rounding_mode) +BigInt* round_temporal_instant(GlobalObject& global_object, BigInt const& nanoseconds, u64 increment, StringView unit, StringView rounding_mode) { // 1. Assert: Type(ns) is BigInt. u64 increment_nanoseconds; // 2. If unit is "hour", then - if (unit == "hour") { + if (unit == "hour"sv) { // a. Let incrementNs be increment × 3.6 × 10^12. increment_nanoseconds = increment * 3600000000000; } // 3. Else if unit is "minute", then - else if (unit == "minute") { + else if (unit == "minute"sv) { // a. Let incrementNs be increment × 6 × 10^10. increment_nanoseconds = increment * 60000000000; } // 4. Else if unit is "second", then - else if (unit == "second") { + else if (unit == "second"sv) { // a. Let incrementNs be increment × 10^9. increment_nanoseconds = increment * 1000000000; } // 5. Else if unit is "millisecond", then - else if (unit == "millisecond") { + else if (unit == "millisecond"sv) { // a. Let incrementNs be increment × 10^6. increment_nanoseconds = increment * 1000000; } // 6. Else if unit is "microsecond", then - else if (unit == "microsecond") { + else if (unit == "microsecond"sv) { // a. Let incrementNs be increment × 10^3. increment_nanoseconds = increment * 1000; } // 7. Else, else { // a. Assert: unit is "nanosecond". - VERIFY(unit == "nanosecond"); + VERIFY(unit == "nanosecond"sv); // b. Let incrementNs be increment. increment_nanoseconds = increment; |