Small typo fixes.
authorErik Verbruggen <erik.verbruggen@me.com>
Fri, 9 Aug 2013 13:37:39 +0000 (15:37 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sat, 17 Aug 2013 13:24:56 +0000 (15:24 +0200)
Change-Id: I4aca4e02e06700738337d92ebfc18995184a31f6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/jsruntime/qv4value_p.h

index b6daae9..986f5e2 100644 (file)
@@ -183,9 +183,7 @@ inline bool Value::toBoolean() const
     case Value::Object_Type:
         return true;
     default: // double
-        if (! doubleValue() || std::isnan(doubleValue()))
-            return false;
-        return true;
+        return doubleValue() && !std::isnan(doubleValue());
     }
 }
 
@@ -212,7 +210,7 @@ inline int Value::toInt32() const
     if ((d >= -D31 && d < D31))
         return static_cast<int>(d);
 
-    return Value::toInt32(__qmljs_to_number(*this));
+    return Value::toInt32(d);
 }
 
 inline unsigned int Value::toUInt32() const
@@ -226,8 +224,8 @@ inline unsigned int Value::toUInt32() const
         d = __qmljs_to_number(*this);
 
     const double D32 = 4294967296.0;
-    if (dbl >= 0 && dbl < D32)
-        return static_cast<uint>(dbl);
+    if (d >= 0 && d < D32)
+        return static_cast<uint>(d);
     return toUInt32(d);
 }