ruby-changes:43007
From: nobu <ko1@a...>
Date: Fri, 20 May 2016 21:17:20 +0900 (JST)
Subject: [ruby-changes:43007] nobu:r55081 (trunk): win32ole.c: share the content
nobu 2016-05-20 21:17:14 +0900 (Fri, 20 May 2016) New Revision: 55081 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55081 Log: win32ole.c: share the content * ext/win32ole/win32ole.c (fole_missing): make substring or dup to share the content if possible. Modified files: trunk/ChangeLog trunk/ext/win32ole/win32ole.c Index: ChangeLog =================================================================== --- ChangeLog (revision 55080) +++ ChangeLog (revision 55081) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri May 20 21:17:13 2016 Nobuyoshi Nakada <nobu@r...> + + * ext/win32ole/win32ole.c (fole_missing): make substring or dup to + share the content if possible. + Fri May 20 19:48:48 2016 Nobuyoshi Nakada <nobu@r...> * internal.h (NEW_PARTIAL_MEMO_FOR): shrink buffer array not to Index: ext/win32ole/win32ole.c =================================================================== --- ext/win32ole/win32ole.c (revision 55080) +++ ext/win32ole/win32ole.c (revision 55081) @@ -3303,12 +3303,12 @@ fole_missing(int argc, VALUE *argv, VALU https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L3303 n = RSTRING_LEN(mid); if(mname[n-1] == '=') { rb_check_arity(argc, 2, 2); - argv[0] = rb_enc_str_new(mname, (n-1), cWIN32OLE_enc); + argv[0] = rb_enc_associate(rb_str_subseq(mid, 0, n-1), cWIN32OLE_enc); return ole_propertyput(self, argv[0], argv[1]); } else { - argv[0] = rb_enc_str_new(mname, n, cWIN32OLE_enc); + argv[0] = rb_enc_associate(rb_str_dup(mid), cWIN32OLE_enc); return ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET, FALSE); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/