]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/generate.cpp
Add push_back_nocopy to NodeContainer for clarity
[libs/gl.git] / source / glsl / generate.cpp
index 70b8ad18efbca4ca6279435c0f908bb8d37eae15..563609918ae216f28178dca421be4c627175f1b5 100644 (file)
@@ -579,8 +579,7 @@ void ExpressionResolver::convert_to(RefPtr<Expression> &expr, BasicTypeDeclarati
        RefPtr<FunctionCall> call = new FunctionCall;
        call->name = type.name;
        call->constructor = true;
-       call->arguments.push_back(0);
-       call->arguments.back() = expr;
+       call->arguments.push_back_nocopy(expr);
        call->type = &type;
        expr = call;
 }
@@ -1015,7 +1014,7 @@ void ExpressionResolver::visit_constructor(FunctionCall &call)
                                        stage inline it if that's reasonable. */
                                        RefPtr<VariableDeclaration> temporary = new VariableDeclaration;
                                        temporary->type = args.front().type->name;
-                                       temporary->name = get_unused_variable_name(*current_block, "_temp", string());
+                                       temporary->name = get_unused_variable_name(*current_block, "_temp");
                                        temporary->init_expression = call.arguments.front();
                                        current_block->body.insert(insert_point, temporary);