[macruby-changes] [3706] MacRuby/branches/icu/dispatcher.cpp

source_changes at macosforge.org source_changes at macosforge.org
Fri Mar 5 15:25:27 PST 2010


Revision: 3706
          http://trac.macosforge.org/projects/ruby/changeset/3706
Author:   lsansonetti at apple.com
Date:     2010-03-05 15:25:24 -0800 (Fri, 05 Mar 2010)
Log Message:
-----------
fixed the #== optimization for strings

Modified Paths:
--------------
    MacRuby/branches/icu/dispatcher.cpp

Modified: MacRuby/branches/icu/dispatcher.cpp
===================================================================
--- MacRuby/branches/icu/dispatcher.cpp	2010-03-05 12:05:52 UTC (rev 3705)
+++ MacRuby/branches/icu/dispatcher.cpp	2010-03-05 23:25:24 UTC (rev 3706)
@@ -1222,22 +1222,31 @@
 	    return self == other ? Qtrue : Qfalse;
 
 	case T_STRING:
+	    if (self == other) {
+		return Qtrue;
+	    }
+	    if (TYPE(other) != self_type) {
+		return Qfalse;
+	    }
+	    return rb_str_equal(self, other);
+
 	case T_ARRAY:
-	case T_HASH:
 	    if (self == other) {
 		return Qtrue;
 	    }
 	    if (TYPE(other) != self_type) {
 		return Qfalse;
 	    }
-	    if (self_type == T_ARRAY) {
-		return rb_ary_equal(self, other);
+	    return rb_ary_equal(self, other);
+
+	case T_HASH:
+	    if (self == other) {
+		return Qtrue;
 	    }
-	    if (self_type == T_HASH) {
-		return rb_hash_equal(self, other);
+	    if (TYPE(other) != self_type) {
+		return Qfalse;
 	    }
-	    return CFEqual((CFTypeRef)self, (CFTypeRef)other)
-		? Qtrue : Qfalse;
+	    return rb_hash_equal(self, other);
 
 	case T_BIGNUM:
 	    return rb_big_eq(self, other);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100305/d1c0a724/attachment.html>


More information about the macruby-changes mailing list