mirror of
https://github.com/darlinghq/darling-libcxx.git
synced 2024-12-14 07:18:38 +00:00
Avoid assignment in return. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273349 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
91a5c559ba
commit
c6fcb58914
@ -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
Block a user