Fix V815:Decreased performance

This commit is contained in:
pavel.pimenov
2017-04-07 15:41:07 +03:00
parent f7df408a6a
commit 6ca374371e
3 changed files with 15 additions and 14 deletions

View File

@@ -137,7 +137,7 @@ bool Reader::parse(const char* beginDoc,
current_ = begin_;
lastValueEnd_ = 0;
lastValue_ = 0;
commentsBefore_ = "";
commentsBefore_.clear();
errors_.clear();
while (!nodes_.empty())
nodes_.pop();
@@ -176,7 +176,7 @@ bool Reader::readValue() {
if (collectComments_ && !commentsBefore_.empty()) {
currentValue().setComment(commentsBefore_, commentBefore);
commentsBefore_ = "";
commentsBefore_.clear();
}
switch (token.type_) {
@@ -474,7 +474,7 @@ bool Reader::readObject(Token& tokenStart) {
break;
if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
return true;
name = "";
name.clear();
if (tokenName.type_ == tokenString) {
if (!decodeString(tokenName, name))
return recoverFromError(tokenObjectEnd);
@@ -1056,7 +1056,7 @@ bool OurReader::parse(const char* beginDoc,
current_ = begin_;
lastValueEnd_ = 0;
lastValue_ = 0;
commentsBefore_ = "";
commentsBefore_.clear();
errors_.clear();
while (!nodes_.empty())
nodes_.pop();
@@ -1098,7 +1098,7 @@ bool OurReader::readValue() {
if (collectComments_ && !commentsBefore_.empty()) {
currentValue().setComment(commentsBefore_, commentBefore);
commentsBefore_ = "";
commentsBefore_.clear();
}
switch (token.type_) {
@@ -1447,7 +1447,7 @@ bool OurReader::readObject(Token& tokenStart) {
break;
if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
return true;
name = "";
name.clear();
if (tokenName.type_ == tokenString) {
if (!decodeString(tokenName, name))
return recoverFromError(tokenObjectEnd);