aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-05-14 00:44:16 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-05-21 15:42:30 +0200
commitb55fd0e9cee91546b57162c6ab80148b7bfb8473 (patch)
tree62d23ccb92bf0d8c999a47e045ba3e8d43ee1964 /lib/stdlib
parent4034b89a07a97766dba5e6213b1eb4d76ba6df9e (diff)
downloadotp-b55fd0e9cee91546b57162c6ab80148b7bfb8473.tar.gz
otp-b55fd0e9cee91546b57162c6ab80148b7bfb8473.tar.bz2
otp-b55fd0e9cee91546b57162c6ab80148b7bfb8473.zip
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.
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/src/erl_anno.erl4
1 files changed, 1 insertions, 3 deletions
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().