@@ -14,25 +14,30 @@ object trace {
14
14
conditionally(ctx.settings.YdebugTrace .value, question, false )(op)
15
15
16
16
@ inline
17
- def conditionally [TC ](cond : Boolean , question : => String , show : Boolean )(op : => TC )(implicit ctx : Context ): TC = {
18
- def op1 = op
19
- if (Config .tracingEnabled && cond) apply[TC ](question, Printers .default, show)(op1)
20
- else op1
21
- }
17
+ def conditionally [TC ](cond : Boolean , question : => String , show : Boolean )(op : => TC )(implicit ctx : Context ): TC =
18
+ if (Config .tracingEnabled) {
19
+ def op1 = op
20
+ if (cond) apply[TC ](question, Printers .default, show)(op1)
21
+ else op1
22
+ } else op
22
23
23
24
@ inline
24
- def apply [T ](question : => String , printer : Printers .Printer , showOp : Any => String )(op : => T )(implicit ctx : Context ): T = {
25
- def op1 = op
26
- if (! Config .tracingEnabled || printer.eq(config.Printers .noPrinter)) op1
27
- else doTrace[T ](question, printer, showOp)(op1)
28
- }
25
+ def apply [T ](question : => String , printer : Printers .Printer , showOp : Any => String )(op : => T )(implicit ctx : Context ): T =
26
+ if (Config .tracingEnabled) {
27
+ def op1 = op
28
+ if (printer.eq(config.Printers .noPrinter)) op1
29
+ else doTrace[T ](question, printer, showOp)(op1)
30
+ }
31
+ else op
29
32
30
33
@ inline
31
- def apply [T ](question : => String , printer : Printers .Printer , show : Boolean )(op : => T )(implicit ctx : Context ): T = {
32
- def op1 = op
33
- if (! Config .tracingEnabled || printer.eq(config.Printers .noPrinter)) op1
34
- else doTrace[T ](question, printer, if (show) showShowable(_) else alwaysToString)(op1)
35
- }
34
+ def apply [T ](question : => String , printer : Printers .Printer , show : Boolean )(op : => T )(implicit ctx : Context ): T =
35
+ if (Config .tracingEnabled) {
36
+ def op1 = op
37
+ if (printer.eq(config.Printers .noPrinter)) op1
38
+ else doTrace[T ](question, printer, if (show) showShowable(_) else alwaysToString)(op1)
39
+ }
40
+ else op
36
41
37
42
@ inline
38
43
def apply [T ](question : => String , printer : Printers .Printer )(op : => T )(implicit ctx : Context ): T =
0 commit comments