From e84a7de390f1b9de1d178d18f76f1a534bb3afee Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 2 Oct 2016 18:56:04 +0200 Subject: [PATCH] - variable was in the wrong scope. --- src/rapidjson/writer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rapidjson/writer.h b/src/rapidjson/writer.h index 369e7e6ff0..a8eeab66d3 100644 --- a/src/rapidjson/writer.h +++ b/src/rapidjson/writer.h @@ -321,8 +321,8 @@ protected: } bool WriteDouble(double d) { - if (internal::Double(d).IsNanOrInf()) { - bool ret = true; + bool ret = true; + if (internal::Double(d).IsNanOrInf()) { if (!(writeFlags & kWriteNanAndInfFlag)) { // if we abort here, the writer is left in a broken state, unable to recover, so better write a 0 in addition to returning an error.