git.iko.soy/typeable/nixpkgs
on master help sign in
nixos: doc: make option sorting somewhat more efficient
commit252ec7da0a1d624db46b299052122b4a5dbf3254 authorJan Malakhovski <oxij@oxij.org> dateSun 11 Feb 2018, 22:06 (9 years ago) parenta3a8c1f
1 file changed+2−3
nixos/doc/manual/default.nix+2−3
nixos/doc/manual/default.nix+2−3
@@ -66,15 +66,14 @@ let
6666 # and ".package"
6767 optionListLess = a: b:
6868 let
69− splt = lib.splitString ".";
7069 ise = lib.hasPrefix "enable";
7170 isp = lib.hasPrefix "package";
7271 cmp = lib.splitByAndCompare ise lib.compare
7372 (lib.splitByAndCompare isp lib.compare lib.compare);
74− in lib.compareLists cmp (splt a) (splt b) < 0;
73+ in lib.compareLists cmp a.loc b.loc < 0;
7574
7675 # Customly sort option list for the man page.
77− optionsList = lib.sort (a: b: optionListLess a.name b.name) optionsListDesc;
76+ optionsList = lib.sort optionListLess optionsListDesc;
7877
7978 # Convert the list of options into an XML file.
8079 optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList);