aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-04-16 18:47:05 +0200
committerAnders Svensson <[email protected]>2017-06-12 16:13:52 +0200
commitb51872b742b18bcb0c53aaeb09713a46ec91f788 (patch)
treed7ec5e4c376e6b91ffab30e95c69d4b969cf1c28 /lib/diameter
parentdff7f1ce02cf1de8233e4e60cc962e346eaee8a8 (diff)
downloadotp-b51872b742b18bcb0c53aaeb09713a46ec91f788.tar.gz
otp-b51872b742b18bcb0c53aaeb09713a46ec91f788.tar.bz2
otp-b51872b742b18bcb0c53aaeb09713a46ec91f788.zip
Remove minor encode bloat
As when detecting missing AVPs, extract a list of field/value pairs in one step, which looks to be slightly more efficient. Flattening the list was unnecessary since the result is passed to list_to_binary.
Diffstat (limited to 'lib/diameter')
-rw-r--r--lib/diameter/include/diameter_gen.hrl3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/diameter/include/diameter_gen.hrl b/lib/diameter/include/diameter_gen.hrl
index f8d6cbde89..e745e3d2d3 100644
--- a/lib/diameter/include/diameter_gen.hrl
+++ b/lib/diameter/include/diameter_gen.hrl
@@ -104,8 +104,7 @@ encode_avps(Name, Rec) ->
%% encode/2
encode(Name, Rec) ->
- lists:flatmap(fun(A) -> encode(Name, A, '#get-'(A, Rec)) end,
- '#info-'(element(1, Rec), fields)).
+ [encode(Name, F, V) || {F,V} <- '#get-'(Rec)].
%% encode/3