瀏覽代碼

optimized Type.enumEq

Nicolas Cannasse 17 年之前
父節點
當前提交
0d907d9e00
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 3 0
      doc/CHANGES.txt
  2. 3 3
      std/Type.hx

+ 3 - 0
doc/CHANGES.txt

@@ -1,3 +1,6 @@
+2009-??-??: 2.03
+	optimized Type.enumEq : use index instead of tag comparison for neko/flash9/php
+
 2008-11-23: 2.02
 	Std.is(MyInterface, Class) now returns true (haXe/PHP)
 	php arrays are wrapped into _hx_array instances, fixes issues with references (array cast, access out of bounds ...)

+ 3 - 3
std/Type.hx

@@ -617,7 +617,7 @@ class Type {
 			return true;
 		#if neko
 			try {
-				if( a.__enum__ == null || a.tag != b.tag )
+				if( a.__enum__ == null || a.index != b.index )
 					return false;
 			} catch( e : Dynamic ) {
 				return false;
@@ -627,7 +627,7 @@ class Type {
 					return false;
 		#elseif flash9
 			try {
-				if( a.tag != b.tag )
+				if( a.index != b.index )
 					return false;
 				for( i in 0...a.params.length )
 					if( !enumEq(a.params[i],b.params[i]) )
@@ -637,7 +637,7 @@ class Type {
 			}
 		#elseif php
 			try {
-				if( a.tag != b.tag )
+				if( a.index != b.index )
 					return false;
 				for( i in 0...__call__("count", a.params))
 					if(getEnum(untyped __php__("$a->params[$i]")) != null) {