From 3c32dca89214c03b107cc9d1c468000cff3f8127 Mon Sep 17 00:00:00 2001 From: lilinchao Date: Tue, 2 Jul 2019 21:15:11 +0800 Subject: [PATCH] adjust some codes position --- src/lib_json/json_reader.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index bbff7ef..53b0b2e 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -1454,18 +1454,18 @@ bool OurReader::readObject(Token& token) { } else { break; } - - Token colon; - if (!readToken(colon) || colon.type_ != tokenMemberSeparator) { - return addErrorAndRecover("Missing ':' after object member name", colon, - tokenObjectEnd); - } if (name.length() >= (1U << 30)) throwRuntimeError("keylength >= 2^30"); if (features_.rejectDupKeys_ && currentValue().isMember(name)) { String msg = "Duplicate key: '" + name + "'"; return addErrorAndRecover(msg, tokenName, tokenObjectEnd); } + + Token colon; + if (!readToken(colon) || colon.type_ != tokenMemberSeparator) { + return addErrorAndRecover("Missing ':' after object member name", colon, + tokenObjectEnd); + } Value& value = currentValue()[name]; nodes_.push(&value); bool ok = readValue();