aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-03-12 16:45:16 +0100
committerBjörn Gustavsson <[email protected]>2013-05-31 14:52:20 +0200
commitf4e25971233abdc0fe8872cb8d7b5113d4198a3d (patch)
treea2f1fec4ea1ce32db9787faf88135f4ff3c120ba /lib/asn1/src/asn1ct_gen.erl
parent66cc5110814e74d602f6bda65e8388babc3982a3 (diff)
downloadotp-f4e25971233abdc0fe8872cb8d7b5113d4198a3d.tar.gz
otp-f4e25971233abdc0fe8872cb8d7b5113d4198a3d.tar.bz2
otp-f4e25971233abdc0fe8872cb8d7b5113d4198a3d.zip
Eliminate the {notype,_} return value from asn1ct_gen:type/1
The last clause in asn1ct_gen:type/1 does a catched call to type2/1. If the type2/1 fails {notype,X} is returned. Since the body of type2/1 essentially is: case lists:member(X, [...]) of true -> {primitive,bif}; false -> case lists:member(X, [...]) of true -> {constructed,bif}; false -> {undefined,user} end end there is no way that type2/1 can fail. Therefore, we can eliminate the catch and put the body of type2/1 into the last clause of type/1. We can also eliminate the code in the callers of type/1 that match {notype,X}.
Diffstat (limited to 'lib/asn1/src/asn1ct_gen.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen.erl9
1 files changed, 0 insertions, 9 deletions
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index 5cddaba52e..978ac280dd 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -1690,15 +1690,6 @@ type({fixedtypevaluefield,_Name,Type}) when is_record(Type,type) ->
type({typefield,_}) ->
'ASN1_OPEN_TYPE';
type(X) ->
- %% io:format("asn1_types:type(~p)~n",[X]),
- case catch type2(X) of
- {'EXIT',_} ->
- {notype,X};
- Normal ->
- Normal
- end.
-
-type2(X) ->
case prim_bif(X) of
true ->
{primitive,bif};