aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_codec_test.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-04-17 10:51:56 +0200
committerAnders Svensson <[email protected]>2017-06-12 16:13:52 +0200
commitf1a78f768414e97d30e72b1530475f2893fc75c5 (patch)
tree6f23e2587cd9b6564e7f642f53705a1a1c21bc1c /lib/diameter/test/diameter_codec_test.erl
parent8c975c3b325c6fa4926c1d12fba0b48e281a08cd (diff)
downloadotp-f1a78f768414e97d30e72b1530475f2893fc75c5.tar.gz
otp-f1a78f768414e97d30e72b1530475f2893fc75c5.tar.bz2
otp-f1a78f768414e97d30e72b1530475f2893fc75c5.zip
Don't create intermediate binaries unnecessarily during encode
Dict:avp(encode, Value, Name) no longer needs to return a binary, only an iolist(). Message encode runs list_to_binary/1 to convert accumulated lists into a message binary.
Diffstat (limited to 'lib/diameter/test/diameter_codec_test.erl')
-rw-r--r--lib/diameter/test/diameter_codec_test.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/diameter/test/diameter_codec_test.erl b/lib/diameter/test/diameter_codec_test.erl
index d8b7377c0c..e041500b37 100644
--- a/lib/diameter/test/diameter_codec_test.erl
+++ b/lib/diameter/test/diameter_codec_test.erl
@@ -209,8 +209,10 @@ avp_decode(Mod, Name, Type, Eq, Value) ->
avp(Mod, decode = X, V, Name, 'Grouped') ->
{Rec, _} = Mod:avp(X, V, Name),
Rec;
-avp(Mod, X, V, Name, _) ->
- Mod:avp(X, V, Name).
+avp(Mod, decode = X, V, Name, _) ->
+ Mod:avp(X, V, Name);
+avp(Mod, encode = X, V, Name, _) ->
+ iolist_to_binary(Mod:avp(X, V, Name)).
%% v/1