This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Avoid mixing assignment and returning.
ClosedPublic

Authored by STL_MSFT on Jun 21 2016, 5:51 PM.

Details

Summary

Avoid mixing assignment and returning. "return locked = true;" looks really suspicious, even though it happens to be correct here. Spend an extra statement to make the code clearer, and compilers happier.

Fixes MSVC warning C6282 "Incorrect operator: assignment of constant in Boolean context. Consider using '==' instead."

Diff Detail

Event Timeline

STL_MSFT updated this revision to Diff 61475.Jun 21 2016, 5:51 PM
STL_MSFT retitled this revision from to [libcxx] [test] Avoid mixing assignment and returning..
STL_MSFT updated this object.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
EricWF accepted this revision.Jun 21 2016, 6:06 PM
EricWF edited edge metadata.

I think your compiler is silly, but I'm happy with the change anyway.

I like that syntax gosh darn it!

This revision is now accepted and ready to land.Jun 21 2016, 6:06 PM
EricWF closed this revision.Jun 21 2016, 6:07 PM

r273349.