mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
json_parser_parse() normally returns the QObject on success. Except it returns null when its @tokens argument is null. Its only caller json_message_process_token() passes null @tokens when emitting a lexical error. The call is a rather opaque way to say json = NULL then. Simplify matters by lifting the assignment to json out of the emit path: initialize json to null, set it to the value of json_parser_parse() when there's no lexical error. Drop the special case from json_parser_parse(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20180823164025.12553-36-armbru@redhat.com> |
||
|---|---|---|
| .. | ||
| block-qdict.c | ||
| json-lexer.c | ||
| json-parser.c | ||
| json-streamer.c | ||
| Makefile.objs | ||
| qbool.c | ||
| qdict.c | ||
| qjson.c | ||
| qlist.c | ||
| qlit.c | ||
| qnull.c | ||
| qnum.c | ||
| qobject.c | ||
| qstring.c | ||