mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 15:32:43 +01:00
Add getConcurrent helper function
This commit is contained in:
parent
377b60ee9b
commit
7f9b5226af
2 changed files with 12 additions and 3 deletions
|
|
@ -95,9 +95,7 @@ std::optional<struct stat> PosixSourceAccessor::cachedLstat(const CanonPath & pa
|
|||
// former is not hashable on libc++.
|
||||
Path absPath = makeAbsPath(path).string();
|
||||
|
||||
std::optional<Cache::mapped_type> res;
|
||||
cache.cvisit(absPath, [&](auto & x) { res.emplace(x.second); });
|
||||
if (res)
|
||||
if (auto res = getConcurrent(cache, absPath))
|
||||
return *res;
|
||||
|
||||
auto st = nix::maybeLstat(absPath.c_str());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue