From: Alberto Gonzalez Date: Thu, 28 May 2020 05:30:00 +0000 (+0000) Subject: printattrs: Simplify `get_indent_str()`. X-Git-Tag: working-ls180~528^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5896ffd56f8d0653c9f7a71f18570d093fe669e8;p=yosys.git printattrs: Simplify `get_indent_str()`. Co-Authored-By: Xiretza --- diff --git a/passes/cmds/printattrs.cc b/passes/cmds/printattrs.cc index d4d57fd85..80dbfa259 100644 --- a/passes/cmds/printattrs.cc +++ b/passes/cmds/printattrs.cc @@ -36,9 +36,7 @@ struct PrintAttrsPass : public Pass { } static std::string get_indent_str(const unsigned int indent) { - //Build the format string (e.g. "%4s") - std::string format_str = stringf("%%%ds", indent); - return stringf(format_str.c_str(), " "); //Use the format string with " " as %s + return stringf("%*s", indent, ""); } static void log_const(const RTLIL::IdString &s, const RTLIL::Const &x, const unsigned int indent) {