Skip to content

Commit

Permalink
getMachines(): Cache result
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Apr 1, 2019
1 parent 2f59b30 commit 2bc6304
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/libstore/machines.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2bc6304

Please sign in to comment.