Browse Source

added merge_sort support (neko 1.8.3)

Nicolas Cannasse 13 years ago
parent
commit
ce112af5d3
1 changed files with 8 additions and 0 deletions
  1. 8 0
      std/neko/_std/Array.hx

+ 8 - 0
std/neko/_std/Array.hx

@@ -287,4 +287,12 @@
 		return a;
 	}
 
+	static function __init__() : Void {
+		try {
+			var msort : Dynamic = neko.Lib.load("std","merge_sort",3);
+			untyped Array.prototype.sort = function(cmp) msort(__this__.__a,__this__.length,cmp);
+		} catch( e : Dynamic ) {
+		}
+	}
+
 }