From 6a97206cebf17f15b5cfede556bcb3c259ce5154 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 6 Aug 2020 03:34:49 +0100 Subject: refactor(tvix): Use absl::btree_map for BasicDerivation's env Change-Id: I111a9a268debea322f23fdced3bed9ff3e8ed3b3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1685 Reviewed-by: glittershark Tested-by: BuildkiteCI --- third_party/nix/src/libstore/derivations.cc | 5 +++-- third_party/nix/src/libstore/derivations.hh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'third_party/nix/src') diff --git a/third_party/nix/src/libstore/derivations.cc b/third_party/nix/src/libstore/derivations.cc index adfc6fc05fc1..0e8b637fa78f 100644 --- a/third_party/nix/src/libstore/derivations.cc +++ b/third_party/nix/src/libstore/derivations.cc @@ -50,8 +50,9 @@ BasicDerivation BasicDerivation::from_proto( result.args.insert(result.args.end(), proto_derivation->args().begin(), proto_derivation->args().end()); - result.env.insert(proto_derivation->env().begin(), - proto_derivation->env().end()); + for (auto [k, v] : proto_derivation->env()) { + result.env.emplace(k, v); + } return result; } diff --git a/third_party/nix/src/libstore/derivations.hh b/third_party/nix/src/libstore/derivations.hh index dfdebdd01ec8..cbfea2050382 100644 --- a/third_party/nix/src/libstore/derivations.hh +++ b/third_party/nix/src/libstore/derivations.hh @@ -44,7 +44,7 @@ using DerivationOutputs = absl::btree_map; output IDs we are interested in. */ using DerivationInputs = absl::btree_map; -using StringPairs = std::map; +using StringPairs = absl::btree_map; struct BasicDerivation { DerivationOutputs outputs; /* keyed on symbolic IDs */ -- cgit 1.4.1