From 232cb70f33fa2618412b814b8f9aa78d1d20ef25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 19 Apr 2016 14:01:39 +0200 Subject: core_pp: Print {file,File} annotations more compactly This will speed up test cases that print all annotations. --- lib/compiler/src/core_pp.erl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/compiler') 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) -> -- cgit v1.2.3