mirror of
https://github.com/YosysHQ/yosys
synced 2025-10-10 09:48:06 +00:00
Add a moving assignment operator for IdString to avoid refcount churn
This commit is contained in:
parent
39c6e06e3d
commit
86d8dd6224
1 changed files with 6 additions and 0 deletions
|
@ -339,6 +339,12 @@ struct RTLIL::IdString
|
||||||
index_ = get_reference(rhs.index_);
|
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) {
|
inline void operator=(const char *rhs) {
|
||||||
IdString id(rhs);
|
IdString id(rhs);
|
||||||
*this = id;
|
*this = id;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue