mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
nixos/btrbk: Optimize sort
This avoids computing the prio more than necessary. The test evaluates to the same derivation hash.
This commit is contained in:
parent
016993237f
commit
7438f4e0de
@ -13,7 +13,7 @@ let
|
||||
mkIf
|
||||
mkOption
|
||||
optionalString
|
||||
sort
|
||||
sortOn
|
||||
types
|
||||
;
|
||||
|
||||
@ -37,7 +37,7 @@ let
|
||||
genConfig = set:
|
||||
let
|
||||
pairs = mapAttrsToList (name: value: { inherit name value; }) set;
|
||||
sortedPairs = sort (a: b: prioOf a < prioOf b) pairs;
|
||||
sortedPairs = sortOn prioOf pairs;
|
||||
in
|
||||
concatMap genPair sortedPairs;
|
||||
genSection = sec: secName: value:
|
||||
|
Loading…
Reference in New Issue
Block a user