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
1 changed files with 2 additions and 2 deletions
|
@ -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 a new issue