mirror of https://github.com/YosysHQ/yosys.git
printattrs: Simplify `get_indent_str()`.
Co-Authored-By: Xiretza <xiretza@xiretza.xyz>
This commit is contained in:
parent
f671c99cb8
commit
5896ffd56f
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue