8000 zend_ast.c: use `smart_str_appendc` for appending single characters by DanielEScherzer · Pull Request #18703 · php/php-src · GitHub
[go: up one dir, main page]

Skip to content

zend_ast.c: use smart_str_appendc for appending single characters #18703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Zend/zend_ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@ static ZEND_COLD void zend_ast_export_class_no_header(smart_str *str, zend_ast_d
smart_str_appends(str, " {\n");
zend_ast_export_stmt(str, decl->child[2], indent + 1);
zend_ast_export_indent(str, indent);
smart_str_appends(str, "}");
smart_str_appendc(str, '}');
}

static ZEND_COLD void zend_ast_export_attribute_group(smart_str *str, zend_ast *ast, int indent) {
Expand Down Expand Up @@ -1899,7 +1899,7 @@ static ZEND_COLD void zend_ast_export_attributes(smart_str *str, zend_ast *ast,
for (i = 0; i < list->children; i++) {
smart_str_appends(str, "#[");
zend_ast_export_attribute_group(str, list->child[i], indent);
smart_str_appends(str, "]");
smart_str_appendc(str, ']');

if (newlines) {
smart_str_appendc(str, '\n');
Expand Down Expand Up @@ -2060,7 +2060,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
case ZEND_AST_OP_ARRAY:
smart_str_appends(str, "Closure(");
smart_str_append(str, zend_ast_get_op_array(ast)->op_array->function_name);
smart_str_appends(str, ")");
smart_str_appendc(str, ')');
break;
case ZEND_AST_CONSTANT_CLASS:
smart_str_appendl(str, "__CLASS__", sizeof("__CLASS__")-1);
Expand Down Expand Up @@ -2427,9 +2427,9 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
case ZEND_AST_CALL: {
zend_ast *left = ast->child[0];
if (left->kind == ZEND_AST_ARROW_FUNC || left->kind == ZEND_AST_CLOSURE) {
smart_str_appends(str, "(");
smart_str_appendc(str, '(');
zend_ast_export_ns_name(str, left, 0, indent);
smart_str_appends(str, ")");
smart_str_appendc(str, ')');
} else {
zend_ast_export_ns_name(str, left, 0, indent);
}
Expand Down Expand Up @@ -2679,9 +2679,9 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
smart_str_appends(str, " {\n");
zend_ast_export_ex(str, ast->child[1], 0, indent + 1);
zend_ast_export_indent(str, indent);
smart_str_appends(str, "}");
smart_str_appendc(str, '}');
} else {
smart_str_appends(str, ";");
smart_str_appendc(str, ';');
}
break;
case ZEND_AST_TRAIT_PRECEDENCE:
Expand Down
0