File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -725,6 +725,10 @@ yp_statements_node_create(yp_parser_t *parser);
725
725
static void
726
726
yp_statements_node_body_append(yp_statements_node_t *node, yp_node_t *statement);
727
727
728
+ // Get the length of the given StatementsNode node's body.
729
+ static size_t
730
+ yp_statements_node_body_length(yp_statements_node_t *node);
731
+
728
732
// This function is here to allow us a place to extend in the future when we
729
733
// implement our own arena allocation.
730
734
static inline void *
@@ -2654,7 +2658,7 @@ yp_if_node_create(yp_parser_t *parser,
2654
2658
end = end_keyword->end;
2655
2659
} else if (consequent != NULL) {
2656
2660
end = consequent->location.end;
2657
- } else if ((statements != NULL) && (statements->body.size != 0) ) {
2661
+ } else if (yp_statements_node_body_length (statements) != 0) {
2658
2662
end = statements->base.location.end;
2659
2663
} else {
2660
2664
end = predicate->location.end;
@@ -4008,7 +4012,7 @@ yp_rescue_node_reference_set(yp_rescue_node_t *node, yp_node_t *reference) {
4008
4012
static void
4009
4013
yp_rescue_node_statements_set(yp_rescue_node_t *node, yp_statements_node_t *statements) {
4010
4014
node->statements = statements;
4011
- if ((statements != NULL) && (statements->body.size > 0) ) {
4015
+ if (yp_statements_node_body_length (statements) > 0 ) {
4012
4016
node->base.location.end = statements->base.location.end;
4013
4017
}
4014
4018
}
You can’t perform that action at this time.
0 commit comments