Skip to content

Commit 0e58fa4

Browse files
viuginick1valich
authored andcommitted
Optimized unnecessary to_s
1 parent 4333f10 commit 0e58fa4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/ruby-debug-ide/commands/variables.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ def execute
129129
locals = @state.context.frame_locals(@state.frame_pos)
130130
_self = @state.context.frame_self(@state.frame_pos)
131131
begin
132-
_self_str = exec_with_allocation_control(_self, ENV['DEBUGGER_MEMORY_LIMIT'].to_i, ENV['INSPECT_TIME_LIMIT'].to_i, :to_s, false)
133-
locals['self'] = _self unless "main" == _self_str
132+
locals['self'] = _self unless TOPLEVEL_BINDING.eval('self') == _self
134133
rescue => ex
135134
locals['self'] = "<Cannot evaluate self>"
136135
$stderr << "Cannot evaluate self\n#{ex.class.name}: #{ex.message}\n #{ex.backtrace.join("\n ")}"

0 commit comments

Comments
 (0)