json-parser: drop superfluous assignment for token variable
Signed-off-by: ChenLiang <chenliang88@huawei.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
		
							parent
							
								
									075ccb6cd3
								
							
						
					
					
						commit
						a491af471b
					
				@ -423,7 +423,6 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
 | 
				
			|||||||
    if (!token_is_operator(token, '{')) {
 | 
					    if (!token_is_operator(token, '{')) {
 | 
				
			||||||
        goto out;
 | 
					        goto out;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    token = NULL;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    dict = qdict_new();
 | 
					    dict = qdict_new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -449,7 +448,6 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
 | 
				
			|||||||
                parse_error(ctxt, token, "expected separator in dict");
 | 
					                parse_error(ctxt, token, "expected separator in dict");
 | 
				
			||||||
                goto out;
 | 
					                goto out;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            token = NULL;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (parse_pair(ctxt, dict, ap) == -1) {
 | 
					            if (parse_pair(ctxt, dict, ap) == -1) {
 | 
				
			||||||
                goto out;
 | 
					                goto out;
 | 
				
			||||||
@ -461,10 +459,8 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
 | 
				
			|||||||
                goto out;
 | 
					                goto out;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        token = NULL;
 | 
					 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        token = parser_context_pop_token(ctxt);
 | 
					        (void)parser_context_pop_token(ctxt);
 | 
				
			||||||
        token = NULL;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return QOBJECT(dict);
 | 
					    return QOBJECT(dict);
 | 
				
			||||||
@ -487,10 +483,8 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!token_is_operator(token, '[')) {
 | 
					    if (!token_is_operator(token, '[')) {
 | 
				
			||||||
        token = NULL;
 | 
					 | 
				
			||||||
        goto out;
 | 
					        goto out;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    token = NULL;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    list = qlist_new();
 | 
					    list = qlist_new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -523,8 +517,6 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
 | 
				
			|||||||
                goto out;
 | 
					                goto out;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            token = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            obj = parse_value(ctxt, ap);
 | 
					            obj = parse_value(ctxt, ap);
 | 
				
			||||||
            if (obj == NULL) {
 | 
					            if (obj == NULL) {
 | 
				
			||||||
                parse_error(ctxt, token, "expecting value");
 | 
					                parse_error(ctxt, token, "expecting value");
 | 
				
			||||||
@ -539,11 +531,8 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
 | 
				
			|||||||
                goto out;
 | 
					                goto out;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        token = NULL;
 | 
					 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        token = parser_context_pop_token(ctxt);
 | 
					        (void)parser_context_pop_token(ctxt);
 | 
				
			||||||
        token = NULL;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return QOBJECT(list);
 | 
					    return QOBJECT(list);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user