From 53210f62a94126b643666886dfbefb8bae9e86a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 21 Dec 2012 09:59:29 +0100 Subject: Slightly optimize per encoding of large INTEGERs with constraints --- lib/asn1/src/asn1ct_gen_per_rt2ct.erl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/asn1/src') 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]). -- cgit v1.2.3