From 252ec7da0a1d624db46b299052122b4a5dbf3254 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sun, 11 Feb 2018 22:06:50 +0000 Subject: [PATCH] nixos: doc: make option sorting somewhat more efficient --- nixos/doc/manual/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index 66fa4f0ba43c..e7d6c822e51f 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -66,15 +66,14 @@ let # and ".package" optionListLess = a: b: let - splt = lib.splitString "."; ise = lib.hasPrefix "enable"; isp = lib.hasPrefix "package"; cmp = lib.splitByAndCompare ise lib.compare (lib.splitByAndCompare isp lib.compare lib.compare); - in lib.compareLists cmp (splt a) (splt b) < 0; + in lib.compareLists cmp a.loc b.loc < 0; # Customly sort option list for the man page. - optionsList = lib.sort (a: b: optionListLess a.name b.name) optionsListDesc; + optionsList = lib.sort optionListLess optionsListDesc; # Convert the list of options into an XML file. optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList);