aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-07-17 11:14:32 +0200
committerAnders Svensson <[email protected]>2017-08-10 18:12:49 +0200
commitbaa65db0f00c84c7248d2401272569f1daf2e2b9 (patch)
treed98ad9ffc2fad96743c7c6fb037c03d7d8969b3e
parent97256c5e098f36ee3459db768775c951e87ca717 (diff)
downloadotp-baa65db0f00c84c7248d2401272569f1daf2e2b9.tar.gz
otp-baa65db0f00c84c7248d2401272569f1daf2e2b9.tar.bz2
otp-baa65db0f00c84c7248d2401272569f1daf2e2b9.zip
Don't search forms unnecessarily in diameter_exprecs parse transform
The forms being extracted are in the head of the split.
-rw-r--r--lib/diameter/src/compiler/diameter_exprecs.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/diameter/src/compiler/diameter_exprecs.erl b/lib/diameter/src/compiler/diameter_exprecs.erl
index 9a0cb6baf2..143dede037 100644
--- a/lib/diameter/src/compiler/diameter_exprecs.erl
+++ b/lib/diameter/src/compiler/diameter_exprecs.erl
@@ -110,9 +110,9 @@
%% parse_transform/2
parse_transform(Forms, _Options) ->
- Rs = [R || {attribute, _, record, R} <- Forms],
- Es = lists:append([E || {attribute, _, export_records, E} <- Forms]),
{H,T} = lists:splitwith(fun is_head/1, Forms),
+ Rs = [R || {attribute, _, record, R} <- H],
+ Es = lists:append([E || {attribute, _, export_records, E} <- H]),
H ++ [a_export(Es) | f_accessors(Es, Rs)] ++ T.
is_head(T) ->