Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp A. Hartmann <pah@qo.cx>2014-08-31 20:58:14 +0400
committerPhilipp A. Hartmann <pah@qo.cx>2014-08-31 21:01:16 +0400
commitfd2ba0bc44c97147694cce5c5e965bb7d2f370d5 (patch)
tree55809ad64d253b9843888b2322e42c3fba1e35e2 /include/rapidjson
parent47c32eee6b485c93b048af7b18351f6b2d29283d (diff)
GenericValue: fix comparison of (Ui|I)nt64 numbers
Some 64-bit integers cannot be represented losslessly as a double. Due to a typo in the operator==, the comparison has been performed after a double conversion in too many cases.
Diffstat (limited to 'include/rapidjson')
-rw-r--r--include/rapidjson/document.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h
index 92c73161..ec7f8a6f 100644
--- a/include/rapidjson/document.h
+++ b/include/rapidjson/document.h
@@ -662,7 +662,7 @@ public:
return StringEqual(rhs);
case kNumberType:
- if (IsDouble() || rhs.GetDouble())
+ if (IsDouble() || rhs.IsDouble())
return GetDouble() == rhs.GetDouble(); // May convert one operand from integer to double.
else
return data_.n.u64 == rhs.data_.n.u64;