Skip to content

Commit

Permalink
SonarCloud-inspired bug fixes:
Browse files Browse the repository at this point in the history
- copy constructor and assignment operator declared = delete
- compare this==&other in assignment operator

Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed Nov 14, 2019
1 parent f697f42 commit 0776fa0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions PyIlmBase/PyImath/PyImathStringTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -133,7 +135,7 @@ class StringTableDetailT {
> StringTableContainer;
};

} // namespace PyImath
} // namespace

typedef StringTableDetailT<std::string> StringTableDetail;
typedef StringTableDetailT<std::wstring> WStringTableDetail;
Expand Down

0 comments on commit 0776fa0

Please sign in to comment.