mirror of https://github.com/AxioDL/metaforce.git
hecl/hecl: Collapse InProgress() into std::any_of()
Same thing, more straightforward.
This commit is contained in:
parent
e96eb4cac6
commit
32fec587b5
|
@ -129,10 +129,8 @@ static std::unordered_map<std::thread::id, ProjectPath> PathsInProgress;
|
|||
|
||||
bool ResourceLock::InProgress(const ProjectPath& path) {
|
||||
std::unique_lock lk{PathsMutex};
|
||||
for (const auto& p : PathsInProgress)
|
||||
if (p.second == path)
|
||||
return true;
|
||||
return false;
|
||||
return std::any_of(PathsInProgress.cbegin(), PathsInProgress.cend(),
|
||||
[&path](const auto& entry) { return entry.second == path; });
|
||||
}
|
||||
|
||||
bool ResourceLock::SetThreadRes(const ProjectPath& path) {
|
||||
|
|
Loading…
Reference in New Issue