[ruby/yarp] simplify context_pop
https://github.com/ruby/yarp/commit/fe85b595b6
This commit is contained in:
parent
062eec7558
commit
36e210718c
@ -4902,14 +4902,9 @@ context_push(yp_parser_t *parser, yp_context_t context) {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
context_pop(yp_parser_t *parser) {
|
context_pop(yp_parser_t *parser) {
|
||||||
if (parser->current_context->prev == NULL) {
|
|
||||||
free(parser->current_context);
|
|
||||||
parser->current_context = NULL;
|
|
||||||
} else {
|
|
||||||
yp_context_node_t *prev = parser->current_context->prev;
|
yp_context_node_t *prev = parser->current_context->prev;
|
||||||
free(parser->current_context);
|
free(parser->current_context);
|
||||||
parser->current_context = prev;
|
parser->current_context = prev;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user