mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 11:23:36 +08:00
compact! only returns array if changes were made
This commit is contained in:
parent
6c172a30d3
commit
df916e86b7
|
@ -21,8 +21,8 @@ module MemoryDiagnostics
|
||||||
require 'objspace'
|
require 'objspace'
|
||||||
diff = diff.map do |id|
|
diff = diff.map do |id|
|
||||||
ObjectSpace._id2ref(id) rescue nil
|
ObjectSpace._id2ref(id) rescue nil
|
||||||
end.compact!
|
end
|
||||||
diff ||= []
|
diff.compact!
|
||||||
|
|
||||||
report = "#{diff.length} objects have leaked\n"
|
report = "#{diff.length} objects have leaked\n"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user