From eccc9886ea744699ea5e77b20d53fb175c7a9d4e Mon Sep 17 00:00:00 2001 From: suke Date: Wed, 16 Jul 2014 10:34:57 +0000 Subject: * ext/win32ole/win32ole.c (fole_record_method_missing): call rb_hash_fetch instead of rb_hash_aref. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/win32ole/win32ole.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'ext') diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index 3bf1cb4054..57849463ef 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -143,7 +143,7 @@ const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00, #define WC2VSTR(x) ole_wc2vstr((x), TRUE) -#define WIN32OLE_VERSION "1.5.7" +#define WIN32OLE_VERSION "1.5.8" typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX) (REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*); @@ -9280,18 +9280,14 @@ fole_record_typename(VALUE self) * call-seq: * WIN32OLE_RECORD#method_missing(name) * - * Returns value specified by VT_RECORD OLE variable member name. + * Returns value specified by the member name of VT_RECORD OLE variable. + * If the member name is not correct, KeyError exception is raised. */ static VALUE fole_record_method_missing(VALUE self, VALUE name) { - VALUE fields = rb_ivar_get(self, rb_intern("fields")); - VALUE val = rb_hash_aref(fields, rb_sym_to_s(name)); - if (val != Qnil) { - return val; - } - return rb_call_super(0, 0); + return rb_hash_fetch(fields, rb_sym_to_s(name)); } static void -- cgit v1.2.3