From ec48f8f464a63dece47e9af903098387088c68c5 Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 5 Aug 2019 16:31:35 +0100 Subject: ecp5: New Property interface Signed-off-by: David Shah --- common/nextpnr.cc | 2 +- common/nextpnr.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'common') 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 { -- cgit v1.2.3