From 0776fa035bbaa2b0911f0e54d4301ce2ff2078ab Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Thu, 24 Oct 2019 21:23:19 -0700 Subject: [PATCH] SonarCloud-inspired bug fixes: - copy constructor and assignment operator declared = delete - compare this==&other in assignment operator Signed-off-by: Cary Phillips --- PyIlmBase/PyImath/PyImathStringTable.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PyIlmBase/PyImath/PyImathStringTable.h b/PyIlmBase/PyImath/PyImathStringTable.h index b5f0bc6f..2605570c 100644 --- a/PyIlmBase/PyImath/PyImathStringTable.h +++ b/PyIlmBase/PyImath/PyImathStringTable.h @@ -64,7 +64,9 @@ struct StringTableIndex const StringTableIndex & operator = (const StringTableIndex &si) { - _index = si._index; // NOSONAR - suppress SonarCloud warning + if (&si != this) + _index = si._index; + return *this; } @@ -133,7 +135,7 @@ class StringTableDetailT { > StringTableContainer; }; -} // namespace PyImath +} // namespace typedef StringTableDetailT StringTableDetail; typedef StringTableDetailT WStringTableDetail;