Avoid assignment in return. Patch from STL@microsoft.com

llvm-svn: 273349
This commit is contained in:
Eric Fiselier 2016-06-22 01:00:32 +00:00
parent c1d08ff069
commit df839e04b4
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;