mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
win32/registry.rb: make @@type2name an array
* ext/win32/lib/win32/registry.rb (@@type2name): make an array instead of a hash, keys are sequential numbers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
161848b81e
commit
cac0f9bedc
1 changed files with 6 additions and 5 deletions
|
|
@ -377,15 +377,16 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
|
|||
}
|
||||
end
|
||||
|
||||
@@type2name = { }
|
||||
%w[
|
||||
@@type2name = %w[
|
||||
REG_NONE REG_SZ REG_EXPAND_SZ REG_BINARY REG_DWORD
|
||||
REG_DWORD_BIG_ENDIAN REG_LINK REG_MULTI_SZ
|
||||
REG_RESOURCE_LIST REG_FULL_RESOURCE_DESCRIPTOR
|
||||
REG_RESOURCE_REQUIREMENTS_LIST REG_QWORD
|
||||
].each do |type|
|
||||
@@type2name[Constants.const_get(type)] = type
|
||||
end
|
||||
].inject([]) do |ary, type|
|
||||
type.freeze
|
||||
ary[Constants.const_get(type)] = type
|
||||
ary
|
||||
end.freeze
|
||||
|
||||
#
|
||||
# Convert registry type value to readable string.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue