diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-04-01T19·09+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-04-01T19·09+0200 |
commit | 2bc6304793e14e44d6d24c1fb35666352c7106f2 (patch) | |
tree | 01e7940b593f8a0ffb664511b1345106966d854f /src/libstore | |
parent | 2f59b302517dff622743eb081884deacc906b3d1 (diff) |
getMachines(): Cache result
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/machines.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libstore/machines.cc b/src/libstore/machines.cc index edd03d147832..f848582dafd4 100644 --- a/src/libstore/machines.cc +++ b/src/libstore/machines.cc @@ -89,10 +89,11 @@ void parseMachines(const std::string & s, Machines & machines) Machines getMachines() { - Machines machines; - - parseMachines(settings.builders, machines); - + static auto machines = [&]() { + Machines machines; + parseMachines(settings.builders, machines); + return machines; + }(); return machines; } |