mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-05 01:10:24 +00:00
AK: Simplify calculation of the right padding when formatting u64
This commit is contained in:
committed by
Gregory Bertilson
parent
d284b4c2b8
commit
c8958c9e7b
Notes:
github-actions[bot]
2025-11-12 20:42:50 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/c8958c9e7b5 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6750
@@ -337,7 +337,7 @@ ErrorOr<void> FormatBuilder::put_u64(
|
||||
TRY(put_padding(fill, used_by_right_padding));
|
||||
} else if (align == Align::Center) {
|
||||
auto const used_by_left_padding = used_by_padding / 2;
|
||||
auto const used_by_right_padding = ceil_div<size_t, size_t>(used_by_padding, 2);
|
||||
auto const used_by_right_padding = used_by_padding - used_by_left_padding;
|
||||
|
||||
TRY(put_padding(fill, used_by_left_padding));
|
||||
TRY(put_prefix());
|
||||
|
||||
Reference in New Issue
Block a user