[ruby/yarp] simplify context_pop

https://github.com/ruby/yarp/commit/fe85b595b6
This commit is contained in:
Nathan Froyd 2023-08-29 09:48:10 -04:00 committed by git
parent 062eec7558
commit 36e210718c

View File

@ -4902,14 +4902,9 @@ context_push(yp_parser_t *parser, yp_context_t context) {
static void
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;
free(parser->current_context);
parser->current_context = prev;
}
yp_context_node_t *prev = parser->current_context->prev;
free(parser->current_context);
parser->current_context = prev;
}
static bool