Skip to content

Commit fe85b59

Browse files
committed
simplify context_pop
1 parent 157be4f commit fe85b59

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/yarp.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4902,14 +4902,9 @@ context_push(yp_parser_t *parser, yp_context_t context) {
49024902

49034903
static void
49044904
context_pop(yp_parser_t *parser) {
4905-
if (parser->current_context->prev == NULL) {
4906-
free(parser->current_context);
4907-
parser->current_context = NULL;
4908-
} else {
4909-
yp_context_node_t *prev = parser->current_context->prev;
4910-
free(parser->current_context);
4911-
parser->current_context = prev;
4912-
}
4905+
yp_context_node_t *prev = parser->current_context->prev;
4906+
free(parser->current_context);
4907+
parser->current_context = prev;
49134908
}
49144909

49154910
static bool

0 commit comments

Comments
 (0)