[macruby-changes] [141] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Apr 16 12:11:53 PDT 2008


Revision: 141
          http://trac.macosforge.org/projects/ruby/changeset/141
Author:   lsansonetti at apple.com
Date:     2008-04-16 12:11:52 -0700 (Wed, 16 Apr 2008)

Log Message:
-----------
fixing string hashing

Modified Paths:
--------------
    MacRuby/trunk/hash.c
    MacRuby/trunk/string.c

Modified: MacRuby/trunk/hash.c
===================================================================
--- MacRuby/trunk/hash.c	2008-04-16 06:47:27 UTC (rev 140)
+++ MacRuby/trunk/hash.c	2008-04-16 19:11:52 UTC (rev 141)
@@ -61,13 +61,14 @@
 	return a != b;
     }
 #if WITH_OBJC
-    if (rb_obj_is_kind_of(a, rb_cString) && rb_obj_is_kind_of(b, rb_cString)) {
+    if (TYPE(a) == T_STRING && TYPE(b) == T_STRING)
+	return rb_str_hash_cmp(a, b);
 #else
     if (TYPE(a) == T_STRING && RBASIC(a)->klass == rb_cString &&
 	TYPE(b) == T_STRING && RBASIC(b)->klass == rb_cString) {
-#endif
 	return rb_str_hash_cmp(a, b);
     }
+#endif
 
     args[0] = a;
     args[1] = b;

Modified: MacRuby/trunk/string.c
===================================================================
--- MacRuby/trunk/string.c	2008-04-16 06:47:27 UTC (rev 140)
+++ MacRuby/trunk/string.c	2008-04-16 19:11:52 UTC (rev 141)
@@ -2163,7 +2163,7 @@
 int
 rb_str_hash_cmp(VALUE str1, VALUE str2)
 {
-    return CFEqual((CFTypeRef)str1, (CFTypeRef)str2);
+    return CFEqual((CFTypeRef)str1, (CFTypeRef)str2) ? 0 : 1;
 }
 
 #endif

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080416/0ac2ef2c/attachment.html


More information about the macruby-changes mailing list