From: Joel Rosdahl Date: Sun, 18 Feb 2024 08:33:36 +0000 (+0100) Subject: refactor: Avoid raw fmt::format call in TextTable X-Git-Tag: v4.10~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfb7cc7514fcc9481f6284c47f81fba18ff8f679;p=thirdparty%2Fccache.git refactor: Avoid raw fmt::format call in TextTable --- diff --git a/src/util/TextTable.cpp b/src/util/TextTable.cpp index 58d01a63..2727d566 100644 --- a/src/util/TextTable.cpp +++ b/src/util/TextTable.cpp @@ -19,6 +19,7 @@ #include "TextTable.hpp" #include +#include #include @@ -106,8 +107,8 @@ TextTable::render() const for (size_t j = i + 1 - cell.m_colspan; j <= i; ++j) { width += column_widths[j] + (j == i ? 0 : 1); } - r += fmt::format( - (cell.m_right_align ? "{:>{}}" : "{:<{}}"), cell.m_text, width); + r += cell.m_right_align ? FMT("{:>{}}", cell.m_text, width) + : FMT("{:<{}}", cell.m_text, width); } result.append(r, 0, r.find_last_not_of(' ') + 1); result += '\n';