ruby-changes:34753
From: suke <ko1@a...>
Date: Wed, 16 Jul 2014 19:35:04 +0900 (JST)
Subject: [ruby-changes:34753] suke:r46836 (trunk): * ext/win32ole/win32ole.c (fole_record_method_missing): call
suke 2014-07-16 19:34:57 +0900 (Wed, 16 Jul 2014) New Revision: 46836 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46836 Log: * ext/win32ole/win32ole.c (fole_record_method_missing): call rb_hash_fetch instead of rb_hash_aref. Modified files: trunk/ChangeLog trunk/ext/win32ole/win32ole.c Index: ChangeLog =================================================================== --- ChangeLog (revision 46835) +++ ChangeLog (revision 46836) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Jul 16 19:32:23 2014 Masaki Suketa <masaki.suketa@n...> + + * ext/win32ole/win32ole.c (fole_record_method_missing): call + rb_hash_fetch instead of rb_hash_aref. + Wed Jul 16 18:08:47 2014 Koichi Sasada <ko1@a...> * iseq.c (rb_iseq_defined_string): use rb_gc_mark_object() instead of Index: ext/win32ole/win32ole.c =================================================================== --- ext/win32ole/win32ole.c (revision 46835) +++ ext/win32ole/win32ole.c (revision 46836) @@ -143,7 +143,7 @@ const IID IID_IMultiLanguage2 = {0xDCCFC https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L143 #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) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L9280 * 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/