printattrs: Simplify `get_indent_str()`.

Co-Authored-By: Xiretza <xiretza@xiretza.xyz>
This commit is contained in:
Alberto Gonzalez 2020-05-28 05:30:00 +00:00
parent f671c99cb8
commit 5896ffd56f
No known key found for this signature in database
GPG Key ID: 8395A8BA109708B2
1 changed files with 1 additions and 3 deletions

View File

@ -36,9 +36,7 @@ struct PrintAttrsPass : public Pass {
} }
static std::string get_indent_str(const unsigned int indent) { static std::string get_indent_str(const unsigned int indent) {
//Build the format string (e.g. "%4s") return stringf("%*s", indent, "");
std::string format_str = stringf("%%%ds", indent);
return stringf(format_str.c_str(), " "); //Use the format string with " " as %s
} }
static void log_const(const RTLIL::IdString &s, const RTLIL::Const &x, const unsigned int indent) { static void log_const(const RTLIL::IdString &s, const RTLIL::Const &x, const unsigned int indent) {