From b55fd0e9cee91546b57162c6ab80148b7bfb8473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Thu, 14 May 2015 00:44:16 +0200 Subject: stdlib: Optimize erl_anno:is_string/1 erl_anno:is_string/1 is frequently called from erl_lint and thus affects compile time. Using is_list/1 for is_string/1 is sufficient in this case. --- lib/stdlib/src/erl_anno.erl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/stdlib/src') diff --git a/lib/stdlib/src/erl_anno.erl b/lib/stdlib/src/erl_anno.erl index 9fb767fc93..fa83375c34 100644 --- a/lib/stdlib/src/erl_anno.erl +++ b/lib/stdlib/src/erl_anno.erl @@ -150,9 +150,7 @@ is_filename(T) -> is_list(T) orelse is_binary(T). is_string(T) -> - try lists:all(fun(C) when is_integer(C), C >= 0 -> true end, T) - catch _:_ -> false - end. + is_list(T). -spec column(Anno) -> column() | 'undefined' when Anno :: anno(). -- cgit v1.2.3