diff options
author | Björn Gustavsson <[email protected]> | 2017-03-02 10:34:48 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-03-14 09:47:40 +0100 |
commit | f76696a77fbf0ff4af3beec3567d27121ce8061c (patch) | |
tree | 8c437ede2ba5971c7d1d68d54b16b2ece4db05ff /lib/asn1/src | |
parent | 1831c36cc0d7c98917ae3bd274071c9c450a9c02 (diff) | |
download | otp-f76696a77fbf0ff4af3beec3567d27121ce8061c.tar.gz otp-f76696a77fbf0ff4af3beec3567d27121ce8061c.tar.bz2 otp-f76696a77fbf0ff4af3beec3567d27121ce8061c.zip |
asn1ct_gen_ber_bin_v2: Remove unused code
The code is not covered. The code is also not present
in the PER backend.
Here is a somewhat more formal proof that the code cannot
be reached:
asn1ct_gen_ber_bin_v2:gen_encode_user/3 calls
asn1ct_gen:gen_encode_constructed/4 where Typename is a list
of one element.
asn1ct_gen:gen_encode_constructed/4 will call
asn1ct_gen_ber_bin_v2:gen_encode/3 via asn1ct_gen:gen_types/4.
Note that if InnerType in asn1ct_gen:gen_encode_constructed/4
is 'SEQUENCE OF' or 'SET OF', Typename will be extended to a
list with two elements.
If InnerType in asn1ct_gen:gen_encode_constructed/4 is
'SET', 'SEQUENCE', or 'CHOICE', then asn1ct_gen_ber_bin_v2:gen_encode/3
will be called with the last argument being a #'ComponentType'{}.
asn1ct_gen_ber_bin_v2:gen_encode/3 will in that cause extend
Typename before calling itself recursively.
Therefore, Typename is always a list with at least two elements
when the removed code is called.
Diffstat (limited to 'lib/asn1/src')
-rw-r--r-- | lib/asn1/src/asn1ct_gen_ber_bin_v2.erl | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl b/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl index 6c6d4193f3..4b25b474ff 100644 --- a/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl +++ b/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl @@ -110,15 +110,6 @@ gen_encode(Erules,Typename,Type) when is_record(Type,type) -> emit([nl,nl,nl,"%%================================"]), emit([nl,"%% ",asn1ct_gen:list2name(Typename)]), emit([nl,"%%================================",nl]), - case length(Typename) of - 1 -> % top level type - emit(["'enc_",asn1ct_gen:list2name(Typename), - "'(Val",ObjFun,") ->",nl]), - emit([" 'enc_",asn1ct_gen:list2name(Typename), - "'(Val, ", {asis,lists:reverse(Type#type.tag)},ObjFun,").",nl,nl]); - _ -> % embedded type with constructed name - true - end, emit(["'enc_",asn1ct_gen:list2name(Typename), "'(Val, TagIn",ObjFun,") ->",nl," "]), asn1ct_gen:gen_encode_constructed(Erules,Typename,InnerType,Type); |