Improve MoveSelfInto. NFC.

std::swap is an idiomatic way to do a move.
This commit is contained in:
Ryan Pavlik 2019-05-23 12:27:48 -05:00 committed by whitequark
parent 9fd09ddd8a
commit b9d035c805

View File

@ -514,9 +514,9 @@ public:
void MoveSelfInto(IdList<T,H> *l) {
l->Clear();
*l = *this;
elemsAllocated = n = 0;
elem = NULL;
std::swap(l->elem, elem);
std::swap(l->elemsAllocated, elemsAllocated);
std::swap(l->n, n);
}
void DeepCopyInto(IdList<T,H> *l) {