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:
Eric Fiselier 2016-06-22 01:00:32 +00:00
parent 91a5c559ba
commit c6fcb58914
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;