Skip to content

Commit 1e711eb

Browse files
committed
library.cpp: fixed bugprone-unhandled-self-assignment clang-tidy warning
1 parent 86387f9 commit 1e711eb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/library.cpp

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

158158
Library& Library::operator=(const Library& other) &
159159
{
160+
if (this == &other)
161+
return *this;
162+
160163
mData.reset(new LibraryData(*other.mData));
161164
return *this;
162165
}

0 commit comments

Comments
 (0)