summaryrefslogtreecommitdiff
path: root/Source/cmFileLockPool.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFileLockPool.cxx')
-rw-r--r--Source/cmFileLockPool.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/cmFileLockPool.cxx b/Source/cmFileLockPool.cxx
index e1f6e948a9..4ca924b217 100644
--- a/Source/cmFileLockPool.cxx
+++ b/Source/cmFileLockPool.cxx
@@ -145,10 +145,7 @@ cmFileLockResult cmFileLockPool::ScopePool::Release(
bool cmFileLockPool::ScopePool::IsAlreadyLocked(
const std::string& filename) const
{
- for (auto const& lock : this->Locks) {
- if (lock.IsLocked(filename)) {
- return true;
- }
- }
- return false;
+ return std::any_of(
+ this->Locks.begin(), this->Locks.end(),
+ [&filename](auto const& lock) { return lock.IsLocked(filename); });
}