mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibJS: Use AK::abs
in TimeZone
This fixes a `-Wabsolute-value` warning emitted because of our use of `abs()` on arguments of type `long long`.
This commit is contained in:
parent
6821cd45ed
commit
cd55b817cf
Notes:
sideshowbarker
2024-07-18 09:04:32 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/cd55b817cfa Pull-request: https://github.com/SerenityOS/serenity/pull/8696 Reviewed-by: https://github.com/Dexesttp Reviewed-by: https://github.com/gunnarbeutner ✅ Reviewed-by: https://github.com/networkException
@ -210,7 +210,7 @@ String format_time_zone_offset_string(double offset_nanoseconds)
|
||||
builder.append('-');
|
||||
|
||||
// 3. Let nanoseconds be abs(offsetNanoseconds) modulo 10^9.
|
||||
auto nanoseconds = abs(offset) % 1000000000;
|
||||
auto nanoseconds = AK::abs(offset) % 1000000000;
|
||||
|
||||
// 4. Let seconds be floor(offsetNanoseconds / 10^9) modulo 60.
|
||||
auto seconds = (offset / 1000000000) % 60;
|
||||
|
Loading…
Reference in New Issue
Block a user