1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

memory_status.rb: remove unused values

* test/lib/memory_status.rb: remove initial status values, which
  are not used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-03-09 03:48:33 +00:00
parent 8f5cbc589c
commit b3f4db9227

View file

@ -1,10 +1,9 @@
# frozen_string_literal: false
module Memory
keys = []
vals = []
case
when File.exist?(procfile = "/proc/self/status") && (pat = /^Vm(\w+):\s+(\d+)/) =~ File.binread(procfile)
when File.exist?(procfile = "/proc/self/status") && (pat = /^Vm(\w+):\s+(\d+)/) =~ (data = File.binread(procfile))
PROC_FILE = procfile
VM_PAT = pat
def self.read_status
@ -13,7 +12,7 @@ module Memory
end
end
read_status {|k, v| keys << k; vals << v}
data.scan(pat) {|k, v| keys << k.downcase.intern}
when /mswin|mingw/ =~ RUBY_PLATFORM
require 'fiddle/import'