Skip to content

Commit f4a51c6

Browse files
committed
library.cpp: fixed bugprone-unhandled-self-assignment clang-tidy warning
1 parent e255a78 commit f4a51c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: lib/library.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ Library::Library(const Library& other)
155155

156156
Library& Library::operator=(const Library& other) &
157157
{
158+
if (this == &other)
159+
return *this;
160+
158161
mData.reset(new LibraryData(*other.mData));
159162
return *this;
160163
}

0 commit comments

Comments
 (0)