From b5ad77ea8cb521660d612cdebfbb2bda50724dd9 Mon Sep 17 00:00:00 2001 From: Viktar Lukashonak Date: Thu, 2 Feb 2023 13:26:05 +0300 Subject: [PATCH] Avoid of unnecessary string transformation Signed-off-by: Viktar Lukashonak --- src/modules/clock.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index 0e1ea606..6a06193f 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -281,9 +281,7 @@ auto getCalendarLine(date::year_month_day const currDate, date::year_month const switch (line) { case 0: { // Output month and year title - Glib::ustring wd_ustring{ - Glib::ustring::format(std::left, date::format(*locale_, "%B %Y", ym), std::right)}; - res << wd_ustring; + res << date::format(*locale_, "%B %Y", ym); break; } case 1: { @@ -418,7 +416,7 @@ auto waybar::modules::Clock::get_calendar(const date::zoned_seconds& now, } os << fmt::format( - fmt::runtime((cldWPos_ == WeeksSide::RIGHT || line == 0) ? "{:<{}}" : "{:>{}}"), + fmt::runtime((cldWPos_ != WeeksSide::LEFT || line == 0) ? "{:<{}}" : "{:>{}}"), getCalendarLine(currDate, ymTmp, line, firstdow, &locale_), (cldMonColLen_ + ((line < 2) ? cldWnLen_ : 0)));