diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/nextpnr.cc | 2 | ||||
-rw-r--r-- | common/nextpnr.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc index 8f172422..0d89b55a 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -135,7 +135,7 @@ Property::Property() : is_string(false), str(""), intval(0) {} Property::Property(int64_t intval, int width) : is_string(false), intval(intval) { - str.resize(width); + str.reserve(width); for (int i = 0; i < width; i++) str.push_back((intval & (1ULL << i)) ? S1 : S0); } diff --git a/common/nextpnr.h b/common/nextpnr.h index efa326c0..177048bf 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -333,6 +333,7 @@ struct Property NPNR_ASSERT(!is_string); for (auto c : str) result.push_back(c == S1); + return result; } std::string as_string() const { |