There was an error while loading. Please reload this page.
1 parent 49e42a3 commit c4715e3Copy full SHA for c4715e3
1 file changed
src/debug.cr
@@ -2,6 +2,8 @@ require "log"
2
require "colorize"
3
4
module Debug
5
+ private CALLER_PATTERN = /caller:Array\(String\)/i
6
+
7
{% begin %}
8
ACTIVE = {{ env("DEBUG") == "1" }}
9
{% end %}
@@ -69,11 +71,10 @@ module Debug
69
71
%str << " -- "
70
72
73
when .runtime?
- %DEBUG_CALLER_PATTERN = /caller:Array\(String\)/i
74
%caller_list = caller
75
- if %caller_list.any?(&.match(%DEBUG_CALLER_PATTERN))
76
- while !%caller_list.empty? && %caller_list.first? !~ %DEBUG_CALLER_PATTERN
+ if %caller_list.any?(CALLER_PATTERN)
77
+ while !%caller_list.empty? && %caller_list.first? !~ CALLER_PATTERN
78
%caller_list.shift?
79
end
80
0 commit comments