[macruby-changes] [3321] MacRuby/trunk/gcd.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Jan 21 17:22:03 PST 2010


Revision: 3321
          http://trac.macosforge.org/projects/ruby/changeset/3321
Author:   ernest.prabhakar at gmail.com
Date:     2010-01-21 17:21:58 -0800 (Thu, 21 Jan 2010)
Log Message:
-----------
Call rb_Integer directly instead of 'to_i'

Modified Paths:
--------------
    MacRuby/trunk/gcd.c

Modified: MacRuby/trunk/gcd.c
===================================================================
--- MacRuby/trunk/gcd.c	2010-01-22 01:06:15 UTC (rev 3320)
+++ MacRuby/trunk/gcd.c	2010-01-22 01:21:58 UTC (rev 3321)
@@ -25,7 +25,7 @@
 // otherwise there are crashes when one tries to add an instance
 // variable to a queue. (Not that that is a good idea.)
 
-static SEL selClose, selToI;
+static SEL selClose;
 
 typedef struct {
     struct RBasic basic;
@@ -769,7 +769,7 @@
     src->source_enum = (source_enum_t) NUM2LONG(type);
     dispatch_source_type_t c_type = rb_source_enum2type(src->source_enum);
     assert(c_type != NULL);
-    uintptr_t c_handle = NUM2UINT(rb_vm_call(handle, selToI, 0, NULL, false));
+    uintptr_t c_handle = NUM2UINT(rb_Integer(handle));
     unsigned long c_mask = NUM2LONG(mask);
     dispatch_queue_t c_queue = RQueue(queue)->queue;
     src->source = dispatch_source_create(c_type, c_handle, c_mask, c_queue);
@@ -1297,8 +1297,6 @@
 /* Constants for future reference */
     selClose = sel_registerName("close");
     assert(selClose != NULL);
-    selToI = sel_registerName("to_i");
-    assert(selToI != NULL);
 }
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100121/597ea237/attachment.html>


More information about the macruby-changes mailing list