mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
compact! only returns array if changes were made
This commit is contained in:
parent
6c172a30d3
commit
df916e86b7
1 changed files with 2 additions and 2 deletions
|
@ -21,8 +21,8 @@ module MemoryDiagnostics
|
|||
require 'objspace'
|
||||
diff = diff.map do |id|
|
||||
ObjectSpace._id2ref(id) rescue nil
|
||||
end.compact!
|
||||
diff ||= []
|
||||
end
|
||||
diff.compact!
|
||||
|
||||
report = "#{diff.length} objects have leaked\n"
|
||||
|
||||
|
|
Loading…
Reference in a new issue