use vector::swap to avoid data copying