[前][次][番号順一覧][スレッド一覧]

ruby-changes:35125

From: suke <ko1@a...>
Date: Sun, 17 Aug 2014 17:10:57 +0900 (JST)
Subject: [ruby-changes:35125] suke:r47207 (trunk): * ext/win32ole/win32ole.c (ole_invoke): use RHASH_SIZE instead of

suke	2014-08-17 17:10:38 +0900 (Sun, 17 Aug 2014)

  New Revision: 47207

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47207

  Log:
    * ext/win32ole/win32ole.c (ole_invoke): use RHASH_SIZE instead of
      calling Hash#length method.

  Modified files:
    trunk/ChangeLog
    trunk/ext/win32ole/win32ole.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47206)
+++ ChangeLog	(revision 47207)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Aug 17 17:08:12 2014  Masaki Suketa <masaki.suketa@n...>
+
+	* ext/win32ole/win32ole.c (ole_invoke): use RHASH_SIZE instead of
+	  calling Hash#length method.
+
 Sat Aug 16 19:32:06 2014  Masaki Suketa <masaki.suketa@n...>
 
 	* ext/win32ole/win32ole_event.c (evs_length): use RARRAY_LEN instead
Index: ext/win32ole/win32ole.c
===================================================================
--- ext/win32ole/win32ole.c	(revision 47206)
+++ ext/win32ole/win32ole.c	(revision 47207)
@@ -2553,7 +2553,7 @@ ole_invoke(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2553
         /*------------------------------------------
           hash object ==> named dispatch parameters
         --------------------------------------------*/
-        cNamedArgs = NUM2INT(rb_funcall(param, rb_intern("length"), 0));
+        cNamedArgs = RHASH_SIZE(param);
         op.dp.cArgs = cNamedArgs + argc - 2;
         op.pNamedArgs = ALLOCA_N(OLECHAR*, cNamedArgs + 1);
         op.dp.rgvarg = ALLOCA_N(VARIANTARG, op.dp.cArgs);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]