Преглед изворни кода

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):