소스 검색

use NaN/infinity check that is maybe faster

Simon Krajewski 13 년 전
부모
커밋
5f6282bcc7
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      std/haxe/Json.hx

+ 1 - 1
std/haxe/Json.hx

@@ -105,7 +105,7 @@ class Json {
 		case TInt:
 			add(v);
 		case TFloat:
-			add(!Math.isFinite(v) || Math.isNaN(v) ? "null" : v);
+			add(v+1==v ? null : v);
 		case TFunction:
 			add('"<fun>"');
 		case TClass(c):