Skip to content

Commit a6dff63

Browse files
committed
cleanup
1 parent acda439 commit a6dff63

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/ruby-debug-ide/xml_printer.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -400,23 +400,23 @@ def inspect_with_allocation_control(slice, memory_limit)
400400
end
401401

402402
trace.enable
403-
slice.inspect
404-
trace.disable
403+
result = slice.inspect
404+
trace.disable
405+
result
405406
rescue MemoryLimitError => e
406-
@printer.print_exception(e)
407407
return nil
408408
end
409409

410410
def compact_array_str(value)
411411
slice = value[0..10]
412412

413-
if (defined?(JRUBY_VERSION) || ENV['DEBUGGER_MEMORY_LIMIT'].to_i <= 0)
414-
compact = slice.inspect
415-
else
416-
compact = inspect_with_allocation_control(slice, ENV['DEBUGGER_MEMORY_LIMIT'].to_i)
417-
end
413+
compact = if (defined?(JRUBY_VERSION) || ENV['DEBUGGER_MEMORY_LIMIT'].to_i <= 0)
414+
slice.inspect
415+
else
416+
compact = inspect_with_allocation_control(slice, ENV['DEBUGGER_MEMORY_LIMIT'].to_i)
417+
end
418418

419-
if value.size != slice.size
419+
if compact && value.size != slice.size
420420
compact[0..compact.size-2] + ", ...]"
421421
end
422422
compact

0 commit comments

Comments
 (0)