similarity: use swap() where appropriate for quick vector exchange