aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen_per.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-11-16 07:41:44 +0100
committerBjörn Gustavsson <[email protected]>2012-12-06 14:22:36 +0100
commit51733b718f3f57726951177e69eea4d5ad9266c4 (patch)
tree949b4464c734857c72926a662049ea100c075174 /lib/asn1/src/asn1ct_gen_per.erl
parent81d6790acf9d55a63575efd93bdba1629c101b62 (diff)
downloadotp-51733b718f3f57726951177e69eea4d5ad9266c4.tar.gz
otp-51733b718f3f57726951177e69eea4d5ad9266c4.tar.bz2
otp-51733b718f3f57726951177e69eea4d5ad9266c4.zip
Optimize encoding/decoding of NULL in the per and uper back-ends
Don't waste time calling a trivial function in the run-time library for encoding and decoding of NULL values.
Diffstat (limited to 'lib/asn1/src/asn1ct_gen_per.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen_per.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/asn1/src/asn1ct_gen_per.erl b/lib/asn1/src/asn1ct_gen_per.erl
index 3e100fc833..e82c389afc 100644
--- a/lib/asn1/src/asn1ct_gen_per.erl
+++ b/lib/asn1/src/asn1ct_gen_per.erl
@@ -184,7 +184,7 @@ gen_encode_prim(Erules,D,DoTag,Value) when is_record(D,type) ->
{asis,Constraint},",",Value,",",
{asis,NamedNumberList},")"});
'NULL' ->
- emit({"?RT_PER:encode_null(",Value,")"});
+ emit("[]");
'OBJECT IDENTIFIER' ->
emit({"?RT_PER:encode_object_identifier(",Value,")"});
'RELATIVE-OID' ->
@@ -1256,8 +1256,7 @@ gen_dec_prim(Erules,Att,BytesVar) ->
{asis,NamedNumberList},")"})
end;
'NULL' ->
- emit({"?RT_PER:decode_null(",
- BytesVar,")"});
+ emit({"{'NULL',",BytesVar,"}"});
'OBJECT IDENTIFIER' ->
emit({"?RT_PER:decode_object_identifier(",
BytesVar,")"});