瀏覽代碼

[python] use Math.round instead of own function

Dan Korostelev 11 年之前
父節點
當前提交
34849cc8d7
共有 1 個文件被更改,包括 1 次插入5 次删除
  1. 1 5
      std/python/Boot.hx

+ 1 - 5
std/python/Boot.hx

@@ -88,10 +88,6 @@ private class ClassRegistry extends python.lib.Dict<String, HxClassBase> {
 @:preCode("_hx_classes = _hx_ClassRegistry()")
 @:preCode("_hx_classes = _hx_ClassRegistry()")
 @:keep class Boot {
 @:keep class Boot {
 
 
-	static inline function mathRound (v:Float) {
-		return Math.floor(v + 0.5);
-	}
-
 	static var keywords:Set<String> = new Set(
 	static var keywords:Set<String> = new Set(
 	[
 	[
 		"and",      "del",      "from",     "not",      "while",
 		"and",      "del",      "from",     "not",      "while",
@@ -186,7 +182,7 @@ private class ClassRegistry extends python.lib.Dict<String, HxClassBase> {
 		if (isPyFloat(o)) {
 		if (isPyFloat(o)) {
 			try {
 			try {
 				if ( (o:Float) == builtinInt(o)) {
 				if ( (o:Float) == builtinInt(o)) {
-					return builtinStr(mathRound(o));
+					return builtinStr(Math.round(o));
 				} else {
 				} else {
 					return builtinStr(o);
 					return builtinStr(o);
 				}
 				}