aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/include/diameter_gen.hrl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-04-22 23:57:48 +0200
committerAnders Svensson <[email protected]>2017-06-12 16:13:52 +0200
commit7aec6ad7e56a377bf84fe833dfde43f52263224a (patch)
tree51f2bf9c375d5c334dbbb7b2e6c4c9c1bb28c956 /lib/diameter/include/diameter_gen.hrl
parent6e753c9861effb4ae820d7b1ad20fdb66dca34f6 (diff)
downloadotp-7aec6ad7e56a377bf84fe833dfde43f52263224a.tar.gz
otp-7aec6ad7e56a377bf84fe833dfde43f52263224a.tar.bz2
otp-7aec6ad7e56a377bf84fe833dfde43f52263224a.zip
Use avp_arity/1 when creating a zero group
Converting with list_to_binary/1 appears to be faster than the equivalent binary comprehension: << (z(F,A)) || {F,A} <- avp_arity(Name) >>
Diffstat (limited to 'lib/diameter/include/diameter_gen.hrl')
-rw-r--r--lib/diameter/include/diameter_gen.hrl5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/diameter/include/diameter_gen.hrl b/lib/diameter/include/diameter_gen.hrl
index 3c59370e73..f788264647 100644
--- a/lib/diameter/include/diameter_gen.hrl
+++ b/lib/diameter/include/diameter_gen.hrl
@@ -733,10 +733,7 @@ grouped_decode(Name, ComponentAvps) ->
%% ---------------------------------------------------------------------------
empty_group(Name) ->
- list_to_binary(empty_body(Name)).
-
-empty_body(Name) ->
- [z(F, avp_arity(Name, F)) || F <- '#info-'(name2rec(Name), fields)].
+ list_to_binary([z(F,A) || {F,A} <- avp_arity(Name)]).
z(Name, 1) ->
z(Name);