diff options
author | Björn Gustavsson <[email protected]> | 2016-04-19 14:01:39 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-04-21 12:42:01 +0200 |
commit | 232cb70f33fa2618412b814b8f9aa78d1d20ef25 (patch) | |
tree | 680482c0b60ce5703c62558eb10949104fd7ffde /lib/compiler/src | |
parent | 3f1a4f5c2ef43c57ed0e82dcd4189aa36e1bf7aa (diff) | |
download | otp-232cb70f33fa2618412b814b8f9aa78d1d20ef25.tar.gz otp-232cb70f33fa2618412b814b8f9aa78d1d20ef25.tar.bz2 otp-232cb70f33fa2618412b814b8f9aa78d1d20ef25.zip |
core_pp: Print {file,File} annotations more compactly
This will speed up test cases that print all annotations.
Diffstat (limited to 'lib/compiler/src')
-rw-r--r-- | lib/compiler/src/core_pp.erl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/compiler/src/core_pp.erl b/lib/compiler/src/core_pp.erl index c601b13963..88275998be 100644 --- a/lib/compiler/src/core_pp.erl +++ b/lib/compiler/src/core_pp.erl @@ -84,6 +84,9 @@ maybe_anno(Node, Fun, Ctxt, List) -> format_anno([_|_]=List, Ctxt) -> [$[,format_anno_list(List, Ctxt),$]]; +format_anno({file,Name}, _Ctxt) -> + %% Optimization: Reduces file size considerably. + io_lib:format("{'file',~p}", [Name]); format_anno(Tuple, Ctxt) when is_tuple(Tuple) -> [${,format_anno_list(tuple_to_list(Tuple), Ctxt),$}]; format_anno(Val, Ctxt) when is_atom(Val) -> |