Improve MoveSelfInto. NFC.
std::swap is an idiomatic way to do a move.
This commit is contained in:
parent
9fd09ddd8a
commit
b9d035c805
@ -514,9 +514,9 @@ public:
|
|||||||
|
|
||||||
void MoveSelfInto(IdList<T,H> *l) {
|
void MoveSelfInto(IdList<T,H> *l) {
|
||||||
l->Clear();
|
l->Clear();
|
||||||
*l = *this;
|
std::swap(l->elem, elem);
|
||||||
elemsAllocated = n = 0;
|
std::swap(l->elemsAllocated, elemsAllocated);
|
||||||
elem = NULL;
|
std::swap(l->n, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeepCopyInto(IdList<T,H> *l) {
|
void DeepCopyInto(IdList<T,H> *l) {
|
||||||
|
Loading…
Reference in New Issue
Block a user