From 2bc6304793e14e44d6d24c1fb35666352c7106f2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 1 Apr 2019 21:09:35 +0200 Subject: getMachines(): Cache result --- src/libstore/machines.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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; } -- cgit 1.4.1