From 9dde9f0131eb86245e547d6b5984b205d3319cb5 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 27 Apr 2020 18:51:57 -0700 Subject: [PATCH] Reduce library size --- include/fmt/format.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 6ed1a686..edad681f 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1664,8 +1664,7 @@ template class basic_writer { unsigned width = to_unsigned(specs.width); size_t size = f.size(); // The number of code units. size_t num_code_points = width != 0 ? f.width() : size; - if (width <= num_code_points) return f(reserve(size)); - size_t padding = width - num_code_points; + size_t padding = width > num_code_points ? width - num_code_points : 0; size_t left_padding = 0; if (specs.align == align::right) left_padding = padding;