From b3f4db922756d034daa1e2aa27278ea10d94de55 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 9 Mar 2016 03:48:33 +0000 Subject: 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 --- test/lib/memory_status.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/lib') diff --git a/test/lib/memory_status.rb b/test/lib/memory_status.rb index deaaeb2a1b..19b785caf0 100644 --- a/test/lib/memory_status.rb +++ b/test/lib/memory_status.rb @@ -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' -- cgit v1.2.3