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) {
|
bool ResourceLock::InProgress(const ProjectPath& path) {
|
||||||
std::unique_lock lk{PathsMutex};
|
std::unique_lock lk{PathsMutex};
|
||||||
for (const auto& p : PathsInProgress)
|
return std::any_of(PathsInProgress.cbegin(), PathsInProgress.cend(),
|
||||||
if (p.second == path)
|
[&path](const auto& entry) { return entry.second == path; });
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceLock::SetThreadRes(const ProjectPath& path) {
|
bool ResourceLock::SetThreadRes(const ProjectPath& path) {
|
||||||
|
|
Loading…
Reference in New Issue