sterlinghughes closed pull request #884: encoding/json: Remove unnecessary
reads when parsing
URL: https://github.com/apache/mynewt-core/pull/884
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/encoding/json/src/json_decode.c b/encoding/json/src/json_decode.c
index 5fba8bd9d..8d39d240c 100644
--- a/encoding/json/src/json_decode.c
+++ b/encoding/json/src/json_decode.c
@@ -494,8 +494,7 @@ json_internal_read_object(struct json_buffer *jb,
} else if (c == ',') {
state = await_attr;
} else if (c == '}') {
- c = jb->jb_read_next(jb);
- goto good_parse;
+ return 0;
} else {
return JSON_ERR_BADTRAIL;
}
@@ -503,11 +502,7 @@ json_internal_read_object(struct json_buffer *jb,
}
}
- good_parse:
- /* in case there's another object following, consume trailing WS */
- while (isspace((unsigned char) jb->jb_read_next(jb))) {
- }
- return 0;
+ return 0;
}
int
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services