1
0
mirror of synced 2026-05-01 06:00:26 +00:00

Add a moving assignment operator for IdString to avoid refcount churn

This commit is contained in:
Robert O'Callahan
2025-09-12 04:59:20 +00:00
parent 39c6e06e3d
commit 86d8dd6224

View File

@@ -339,6 +339,12 @@ struct RTLIL::IdString
index_ = get_reference(rhs.index_);
}
inline void operator=(IdString &&rhs) {
put_reference(index_);
index_ = rhs.index_;
rhs.index_ = 0;
}
inline void operator=(const char *rhs) {
IdString id(rhs);
*this = id;