aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-12-21 09:59:29 +0100
committerBjörn Gustavsson <[email protected]>2013-01-22 19:20:13 +0100
commit53210f62a94126b643666886dfbefb8bae9e86a2 (patch)
tree97e9c7f5c47ad88ab4144de52e9e698a8734d8ba
parent34baa02a2c41cfbc8c0f53da93157ec28e0c9d96 (diff)
downloadotp-53210f62a94126b643666886dfbefb8bae9e86a2.tar.gz
otp-53210f62a94126b643666886dfbefb8bae9e86a2.tar.bz2
otp-53210f62a94126b643666886dfbefb8bae9e86a2.zip
Slightly optimize per encoding of large INTEGERs with constraints
-rw-r--r--lib/asn1/src/asn1ct_gen_per_rt2ct.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/asn1/src/asn1ct_gen_per_rt2ct.erl b/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
index 88e9bc6020..bf08494c5c 100644
--- a/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
+++ b/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
@@ -535,6 +535,10 @@ emit_enc_integer(_Erule,[{_,{Lb,Ub},Range,_}],Value) when Range =< 65536 ->
nl," end",nl]),
emit_enc_integer_end_case();
+emit_enc_integer(Erule, [{'ValueRange',{Lb,Ub}=VR}], Value)
+ when is_integer(Lb), is_integer(Ub) ->
+ call(Erule, encode_constrained_number, [{asis,VR},Value]);
+
emit_enc_integer(Erule, C, Value) ->
call(Erule, encode_integer, [{asis,C},Value]).