summaryrefslogtreecommitdiff
path: root/ext/win32/lib/win32
diff options
context:
space:
mode:
Diffstat (limited to 'ext/win32/lib/win32')
-rw-r--r--ext/win32/lib/win32/registry.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb
index f0166d69b9..1e12f4bafc 100644
--- a/ext/win32/lib/win32/registry.rb
+++ b/ext/win32/lib/win32/registry.rb
@@ -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.