forked from OSchip/llvm-project
Avoid assignment in return. Patch from STL@microsoft.com
llvm-svn: 273349
This commit is contained in:
parent
c1d08ff069
commit
df839e04b4
|
@ -25,7 +25,7 @@ struct TestMutex {
|
|||
TestMutex() = default;
|
||||
|
||||
void lock() { assert(!locked); locked = true; }
|
||||
bool try_lock() { if (locked) return false; return locked = true; }
|
||||
bool try_lock() { if (locked) return false; locked = true; return true; }
|
||||
void unlock() { assert(locked); locked = false; }
|
||||
|
||||
TestMutex(TestMutex const&) = delete;
|
||||
|
|
|
@ -28,7 +28,7 @@ struct TestMutex {
|
|||
~TestMutex() { assert(!locked); }
|
||||
|
||||
void lock() { assert(!locked); locked = true; }
|
||||
bool try_lock() { if (locked) return false; return locked = true; }
|
||||
bool try_lock() { if (locked) return false; locked = true; return true; }
|
||||
void unlock() { assert(locked); locked = false; }
|
||||
|
||||
TestMutex(TestMutex const&) = delete;
|
||||
|
|
Loading…
Reference in New Issue