aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Abalihin <[email protected]>2015-12-14 19:24:56 +0300
committerPavel Abalihin <[email protected]>2015-12-14 19:24:56 +0300
commit17582bae6c651747d847726db75664838433681e (patch)
treeef6cb82f290522cd988f2a034e28f57194c7d1bc
parenta16b7d63cc665dca90305b146c15de04487808db (diff)
downloadotp-17582bae6c651747d847726db75664838433681e.tar.gz
otp-17582bae6c651747d847726db75664838433681e.tar.bz2
otp-17582bae6c651747d847726db75664838433681e.zip
Don't sort function index when it's not necessary
-rw-r--r--lib/edoc/src/edoc_layout.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/edoc/src/edoc_layout.erl b/lib/edoc/src/edoc_layout.erl
index b67ec31ae3..f723cd8373 100644
--- a/lib/edoc/src/edoc_layout.erl
+++ b/lib/edoc/src/edoc_layout.erl
@@ -180,7 +180,9 @@ layout_module(#xmlElement{name = module, content = Es}=E, Opts) ->
FullDesc = get_content(fullDescription, Desc),
Functions = [{function_name(E), E} || E <- get_content(functions, Es)],
Types = [{type_name(E), E} || E <- get_content(typedecls, Es)],
- SortedFs = lists:sort(Functions),
+ SortedFs = if Opts#opts.sort_functions -> lists:sort(Functions);
+ true -> Functions
+ end,
Body = (navigation("top")
++ [?NL, hr, ?NL, ?NL, {h1, Title}, ?NL]
++ doc_index(FullDesc, Functions, Types)
@@ -204,9 +206,7 @@ layout_module(#xmlElement{name = module, content = Es}=E, Opts) ->
end
++ types(lists:sort(Types), Opts)
++ function_index(SortedFs, Opts#opts.index_columns)
- ++ if Opts#opts.sort_functions -> functions(SortedFs, Opts);
- true -> functions(Functions, Opts)
- end
+ ++ functions(SortedFs, Opts)
++ [hr, ?NL]
++ navigation("bottom")
++ timestamp()),