diff --git a/src/eval.c b/src/eval.c index 55186cd..9a0e79e 100644 --- a/src/eval.c +++ b/src/eval.c @@ -531,23 +531,11 @@ match_pattern_from_var_or_member( next: switch (var_or_member->type) { case APFL_EXPR_ASSIGNABLE_VAR_OR_MEMBER_VAR: - if ((pattern->value.varname = apfl_string_copy_into_new_refcounted( - ctx->allocator, - apfl_string_view_from(var_or_member->var) - )) == NULL) { - result = MATCH_FATAL_ERROR; - goto fail; - } + pattern->value.varname = apfl_refcounted_string_incref(var_or_member->var); return MATCH_OK; case APFL_EXPR_ASSIGNABLE_VAR_OR_MEMBER_DOT: str_value.type = VALUE_STRING; - if ((str_value.string = apfl_string_copy_into_new_refcounted( - ctx->allocator, - apfl_string_view_from(var_or_member->dot.rhs) - )) == NULL) { - result = MATCH_FATAL_ERROR; - goto fail; - } + str_value.string = apfl_refcounted_string_incref(var_or_member->dot.rhs); if (!apfl_resizable_append( ctx->allocator,