From 48654b06afc07dba4342e02293b9adb9776d99d1 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Mon, 8 Feb 2010 10:29:31 +0200 Subject: stdlib: clean up as suggested by tidier Hans Bolinder (the author/maintainer of qlc) prefers for readability reasons to use length/1 in a guard when it is known that the list is guaranteed to be short, so the change suggested by tidier for line 875 of qlc_pt has not been included. --- lib/stdlib/src/edlin.erl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/stdlib/src/edlin.erl') diff --git a/lib/stdlib/src/edlin.erl b/lib/stdlib/src/edlin.erl index 0e98bbaa06..6cb441dbed 100644 --- a/lib/stdlib/src/edlin.erl +++ b/lib/stdlib/src/edlin.erl @@ -30,8 +30,6 @@ -import(lists, [reverse/1, reverse/2]). -%-import([nthtail/2, keysearch/3, prefix/2]). - -export([over_word/3]). @@ -476,8 +474,8 @@ prompt({line,Pbs,_,_}) -> %% case erlang:module_loaded(Mod) of %% true -> %% L = apply(Mod, module_info, []), -%% case keysearch(exports, 1, L) of -%% {value, {_, Exports}} -> +%% case lists:keyfind(exports, 1, L) of +%% {_, Exports} -> %% match(FuncPrefix, Exports, "("); %% _ -> %% no @@ -493,7 +491,7 @@ prompt({line,Pbs,_,_}) -> %% print_matches(Matches), %% no; %% {partial, Str} -> -%% case nthtail(length(Prefix), Str) of +%% case lists:nthtail(length(Prefix), Str) of %% [] -> %% print_matches(Matches), %% {yes, []}; @@ -501,7 +499,7 @@ prompt({line,Pbs,_,_}) -> %% {yes, Remain} %% end; %% {complete, Str} -> -%% {yes, nthtail(length(Prefix), Str) ++ Extra}; +%% {yes, lists:nthtail(length(Prefix), Str) ++ Extra}; %% no -> %% no %% end. -- cgit v1.2.3