aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-04-27 11:36:47 +0200
committerHans Bolinder <[email protected]>2017-04-27 11:36:47 +0200
commitd9c2e78d4e7b6166245e79a70bd4d95c8a1b742a (patch)
treed1eb034d8003915c448791adeaa5c4b44056e16d
parent7ea9972201ec83bafa2f9adb2aa2ae83067cf732 (diff)
parent08cb2781dd3ace11e25e87105ba57b80dab3a52d (diff)
downloadotp-d9c2e78d4e7b6166245e79a70bd4d95c8a1b742a.tar.gz
otp-d9c2e78d4e7b6166245e79a70bd4d95c8a1b742a.tar.bz2
otp-d9c2e78d4e7b6166245e79a70bd4d95c8a1b742a.zip
Merge branch 'hasse/edoc/revert_string_fix'
* hasse/edoc/revert_string_fix: edoc: Revert fixes for string:length/1
-rw-r--r--lib/edoc/src/edoc_layout.erl19
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/edoc/src/edoc_layout.erl b/lib/edoc/src/edoc_layout.erl
index 5b1889ab06..eafab0588e 100644
--- a/lib/edoc/src/edoc_layout.erl
+++ b/lib/edoc/src/edoc_layout.erl
@@ -544,7 +544,7 @@ t_clause(Name, Type, Opts) ->
pp_clause(Pre, Type, Opts) ->
Types = ot_utype([Type]),
- Atom = lists:duplicate(string_length(Pre), $a),
+ Atom = lists:duplicate(string:length(Pre), $a),
Attr = {attribute,0,spec,{{list_to_atom(Atom),0},[Types]}},
L1 = erl_pp:attribute(erl_parse:new_anno(Attr),
[{encoding, Opts#opts.encoding}]),
@@ -566,7 +566,7 @@ format_type(Prefix, _Name, Type, Last, Opts) ->
[{tt, Prefix ++ [" = "] ++ t_utype(Type, Opts) ++ Last}].
pp_type(Prefix, Type, Opts) ->
- Atom = list_to_atom(lists:duplicate(string_length(Prefix), $a)),
+ Atom = list_to_atom(lists:duplicate(string:length(Prefix), $a)),
Attr = {attribute,0,type,{Atom,ot_utype(Type),[]}},
L1 = erl_pp:attribute(erl_parse:new_anno(Attr),
[{encoding, Opts#opts.encoding}]),
@@ -768,21 +768,6 @@ atom(String, #opts{encoding = latin1}) ->
atom(String, #opts{encoding = utf8}) ->
io_lib:write_atom(list_to_atom(String)).
--dialyzer({nowarn_function, string_length/1}).
-string_length(Data) ->
- try iolist_size(Data)
- catch
- _:_ ->
- M = string,
- F = length,
- As = [Data],
- try apply(M, F, As)
- catch
- _:_ ->
- 20
- end
- end.
-
%% <!ATTLIST author
%% name CDATA #REQUIRED
%% email CDATA #IMPLIED