diff --git a/orchagent/saiattr.cpp b/orchagent/saiattr.cpp index 1c24489ed5a5..fb1d320fe4d4 100644 --- a/orchagent/saiattr.cpp +++ b/orchagent/saiattr.cpp @@ -66,12 +66,10 @@ sai_attr_id_t SaiAttrWrapper::getAttrId() const void SaiAttrWrapper::swap(SaiAttrWrapper&& other) { - m_objectType = other.m_objectType; - m_meta = other.m_meta; - m_attr = other.m_attr; - m_serializedAttr = other.m_serializedAttr; - other.m_attr = sai_attribute_t{}; - other.m_serializedAttr.clear(); + std::swap(m_objectType, other.m_objectType); + std::swap(m_meta, other.m_meta); + std::swap(m_attr, other.m_attr); + std::swap(m_serializedAttr, other.m_serializedAttr); } void SaiAttrWrapper::init(