mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
util: prevector's move ctor and move assignment is noexcept
Move operations already are `noexcept`, so add the keyword to the methods. This makes the `PrevectorFillVectorIndirect...` benchmarks about twice as fast on my machine, because otherwise `std::vector` has to use a copy when the vector resizes.
This commit is contained in:
parent
d380d2877e
commit
81f67977f5
1 changed files with 2 additions and 2 deletions
|
@ -264,7 +264,7 @@ public:
|
||||||
fill(item_ptr(0), other.begin(), other.end());
|
fill(item_ptr(0), other.begin(), other.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
prevector(prevector<N, T, Size, Diff>&& other) {
|
prevector(prevector<N, T, Size, Diff>&& other) noexcept {
|
||||||
swap(other);
|
swap(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
prevector& operator=(prevector<N, T, Size, Diff>&& other) {
|
prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
|
||||||
swap(other);
|
swap(other);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue