From 0f8c33af51099d72bd98181dfdae3b205a7435cf Mon Sep 17 00:00:00 2001 From: Viuginov Nickolay Date: Mon, 7 Aug 2017 13:43:21 +0300 Subject: [PATCH] Optimized unnecessary to_s --- lib/ruby-debug-ide/commands/variables.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ruby-debug-ide/commands/variables.rb b/lib/ruby-debug-ide/commands/variables.rb index ccc5841..33c4f8e 100644 --- a/lib/ruby-debug-ide/commands/variables.rb +++ b/lib/ruby-debug-ide/commands/variables.rb @@ -129,8 +129,7 @@ def execute locals = @state.context.frame_locals(@state.frame_pos) _self = @state.context.frame_self(@state.frame_pos) begin - _self_str = exec_with_allocation_control(_self, ENV['DEBUGGER_MEMORY_LIMIT'].to_i, ENV['INSPECT_TIME_LIMIT'].to_i, :to_s, false) - locals['self'] = _self unless "main" == _self_str + locals['self'] = _self unless TOPLEVEL_BINDING.eval('self') == _self rescue => ex locals['self'] = "" $stderr << "Cannot evaluate self\n#{ex.class.name}: #{ex.message}\n #{ex.backtrace.join("\n ")}"