Files
lime/tools/helpers/StringMapHelper.hx
2014-09-30 17:41:57 -07:00

51 lines
727 B
Haxe

package helpers;
import haxe.ds.StringMap;
class StringMapHelper {
public static function copy <T> (source:StringMap <T>):StringMap <T> {
var target = new StringMap <T> ();
for (key in source.keys ()) {
target.set (key, source.get (key));
}
return target;
}
public static function copyKeys <T> (source:StringMap <T>, target:StringMap <T>):Void {
for (key in source.keys ()) {
target.set (key, source.get (key));
}
}
public static function copyUniqueKeys <T> (source:StringMap <T>, target:StringMap <T>):Void {
for (key in source.keys ()) {
if (!target.exists (key)) {
target.set (key, source.get (key));
}
}
}
}