Răsfoiți Sursa

removed Map -> HashMap conversion (fixed issue #1740)

Simon Krajewski 12 ani în urmă
părinte
comite
850ce819ec
2 a modificat fișierele cu 1 adăugiri și 15 ștergeri
  1. 1 9
      std/Map.hx
  2. 0 6
      std/haxe/ds/HashMap.hx

+ 1 - 9
std/Map.hx

@@ -137,10 +137,6 @@ abstract Map< K, V > (IMap< K, V > ) {
 		return new IntMap<V>();
 		return new IntMap<V>();
 	}
 	}
 
 
-	//@:to static inline function toHashMap<K:Hashable>(t:IMap < K, V >):HashMap<K,V> {
-		//return new HashMap<K, V>();
-	//}
-	
 	@:to static inline function toObjectMap<K:{ }>(t:IMap < K, V >):ObjectMap<K,V> {
 	@:to static inline function toObjectMap<K:{ }>(t:IMap < K, V >):ObjectMap<K,V> {
 		return new ObjectMap<K, V>();
 		return new ObjectMap<K, V>();
 	}
 	}
@@ -152,11 +148,7 @@ abstract Map< K, V > (IMap< K, V > ) {
 	@:from static inline function fromIntMap<V>(map:IntMap<V>):Map< Int, V > {
 	@:from static inline function fromIntMap<V>(map:IntMap<V>):Map< Int, V > {
 		return map;
 		return map;
 	}
 	}
-	
-	//@:from static inline function fromHashMap < K:Hashable, V > (map:HashMap< K, V > ):Map< K, V > {
-		//return map;
-	//}
-	
+
 	@:from static inline function fromObjectMap < K: { }, V > (map:ObjectMap< K, V > ):Map< K, V > {
 	@:from static inline function fromObjectMap < K: { }, V > (map:ObjectMap< K, V > ):Map< K, V > {
 		return map;
 		return map;
 	}	
 	}	

+ 0 - 6
std/haxe/ds/HashMap.hx

@@ -45,10 +45,4 @@ abstract HashMap<K:{ function hashCode():Int; }, V >({keys:IntMap<K>, values:Int
 	public inline function iterator() {
 	public inline function iterator() {
 		return this.values.iterator();
 		return this.values.iterator();
 	}
 	}
-	
-	// TODO: this is required because abstracts do not unify against structures even
-	// if they are structurally compatible
-	@:to function toIMap():Map.IMap<K,V> {
-		return untyped this;
-	}
 }
 }