3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-21 21:33:40 +00:00

Use compiler-generated default constructor for RTLIL::Const::Const

No need for a manual implementation.
While at it: have the constructor that takes a string take a
const string reference instead to avoid a copy.
This commit is contained in:
Henner Zeller 2022-06-06 13:03:47 -07:00 committed by Lofty
parent 9d41aa8e28
commit 9c41b43191
2 changed files with 3 additions and 11 deletions

View file

@ -204,7 +204,7 @@ RTLIL::Const::Const()
flags = RTLIL::CONST_FLAG_NONE;
}
RTLIL::Const::Const(std::string str)
RTLIL::Const::Const(const std::string &str)
{
flags = RTLIL::CONST_FLAG_STRING;
bits.reserve(str.size() * 8);
@ -243,14 +243,6 @@ RTLIL::Const::Const(const std::vector<bool> &bits)
this->bits.emplace_back(b ? State::S1 : State::S0);
}
RTLIL::Const::Const(const RTLIL::Const &c)
{
flags = c.flags;
this->bits.reserve(c.size());
for (const auto &b : c.bits)
this->bits.push_back(b);
}
bool RTLIL::Const::operator <(const RTLIL::Const &other) const
{
if (bits.size() != other.bits.size())