diff options
author | Anders Svensson <[email protected]> | 2017-04-16 18:47:05 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2017-06-12 16:13:52 +0200 |
commit | b51872b742b18bcb0c53aaeb09713a46ec91f788 (patch) | |
tree | d7ec5e4c376e6b91ffab30e95c69d4b969cf1c28 | |
parent | dff7f1ce02cf1de8233e4e60cc962e346eaee8a8 (diff) | |
download | otp-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.
-rw-r--r-- | lib/diameter/include/diameter_gen.hrl | 3 |
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 |