diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index e629a800c76..a79d7c3a024 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -610,9 +610,7 @@ Attribute::~Attribute() Attribute & Attribute::operator=(const Attribute &original) { - if (&original != this) { - setId(original.id); - } + IdComponent::operator=(original); return *this; } diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 248e71f9571..48358b3a5cb 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -279,9 +279,7 @@ Group::~Group() Group & Group::operator=(const Group &original) { - if (&original != this) { - setId(original.id); - } + IdComponent::operator=(original); return *this; }