diff options
author | Anders Svensson <[email protected]> | 2017-04-16 09:51:34 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2017-06-12 16:13:52 +0200 |
commit | f2e75976772b6a1d52a2c71ec1eecb4b338ed632 (patch) | |
tree | cb2fc7594cd6f2d12d3b673a2c3db476212f0fd8 /lib/diameter/include/diameter_gen.hrl | |
parent | 0911c97768caeb908c3f18fd1ba514c1c7f273d5 (diff) | |
download | otp-f2e75976772b6a1d52a2c71ec1eecb4b338ed632.tar.gz otp-f2e75976772b6a1d52a2c71ec1eecb4b338ed632.tar.bz2 otp-f2e75976772b6a1d52a2c71ec1eecb4b338ed632.zip |
Replace slow binary comprehensions
Which appears to be about an order of magnitude slower than just
creating a binary of the desired size.
Diffstat (limited to 'lib/diameter/include/diameter_gen.hrl')
-rw-r--r-- | lib/diameter/include/diameter_gen.hrl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/diameter/include/diameter_gen.hrl b/lib/diameter/include/diameter_gen.hrl index 09af829259..f8d6cbde89 100644 --- a/lib/diameter/include/diameter_gen.hrl +++ b/lib/diameter/include/diameter_gen.hrl @@ -723,7 +723,8 @@ z('AVP') -> <<0:64/integer>>; %% minimal header z(Name) -> Bin = diameter_codec:pack_avp(avp_header(Name), empty_value(Name)), - << <<0>> || <<_>> <= Bin >>. + Sz = size(Bin), + <<0:Sz/unit:8>>. %% --------------------------------------------------------------------------- %% # empty/1 |