Unverified Commit 4f2d8155 authored by Philip Taron's avatar Philip Taron Committed by GitHub
Browse files

splice: replace listToAttrs+map with mapAttrs (#506588)

parents fc9fe845 6ae8efaf
Loading
Loading
Loading
Loading
+34 −35
Original line number Diff line number Diff line
@@ -31,11 +31,11 @@ let
        # The same pkgs sets one probably intends
        // inputs.buildHost
        // inputs.hostTarget;
      merge = name: {
        inherit name;
        value =
      # perf: mapAttrs defers merge calls until a key is selected, avoiding
      # ~60k eager closures that listToAttrs+map would create.
      merge =
        name: defaultValue:
        let
            defaultValue = mash.${name};
          # `or {}` is for the non-derivation attsert splicing case, where `{}` is the identity.
          value' = mapCrossIndex (x: x.${name} or { }) inputs;

@@ -65,9 +65,8 @@ let
          # Don't be fancy about non-derivations. But we could have used used
          # `__functor__` for functions instead.
          defaultValue;
      };
    in
    lib.listToAttrs (map merge (lib.attrNames mash));
    builtins.mapAttrs merge mash;

  splicePackages =
    {