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:
authorKosta <konstantin.baumann@autodesk.com>2014-09-04 20:00:05 +0400
committerKosta <konstantin.baumann@autodesk.com>2014-09-04 20:00:05 +0400
commitf0d9ab4ec93034f66485c70f851b8872c8d6fde0 (patch)
treec6796762b92fb51e8038ede2baa145fae768da6f /include/rapidjson
parent00ac1024eee997815f422f67055415cc1b3ccb3b (diff)
finally fixing `Reader::ParseString()`
It was a copy-n-paste error for the last argument of `Key()` and `String()`...
Diffstat (limited to 'include/rapidjson')
-rw-r--r--include/rapidjson/reader.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h
index 885fe229..f41ba2fd 100644
--- a/include/rapidjson/reader.h
+++ b/include/rapidjson/reader.h
@@ -630,20 +630,17 @@ private:
RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
size_t length = s.PutEnd(head) - 1;
RAPIDJSON_ASSERT(length <= 0xFFFFFFFF);
- const typename TargetEncoding::Ch* const str = (const typename TargetEncoding::Ch*)head;
+ const typename TargetEncoding::Ch* const str = (typename TargetEncoding::Ch*)head;
success = (isKey ? handler.Key(str, SizeType(length), false) : handler.String(str, SizeType(length), false));
}
else {
StackStream stackStream(stack_);
ParseStringToStream<parseFlags, SourceEncoding, TargetEncoding>(s, stackStream);
RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
- success = (isKey
- ? handler.Key( stack_.template Pop<typename TargetEncoding::Ch>(stackStream.length_), stackStream.length_ - 1, false)
- : handler.String(stack_.template Pop<typename TargetEncoding::Ch>(stackStream.length_), stackStream.length_ - 1, false)
- );
+ const typename TargetEncoding::Ch* const str = stack_.template Pop<typename TargetEncoding::Ch>(stackStream.length_);
+ success = (isKey ? handler.Key(str, stackStream.length_ - 1, true) : handler.String(str, stackStream.length_ - 1, true));
}
-
- if(!success)
+ if (!success)
RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell());
}