From 1091995f8e5ba79d659ab39fe4dbbca26ad01488 Mon Sep 17 00:00:00 2001
From: ReinUsesLisp <reinuseslisp@airmail.cc>
Date: Wed, 16 Jun 2021 05:02:19 -0300
Subject: shader: Simplify MergeDualVertexPrograms

---
 src/shader_recompiler/frontend/maxwell/translate_program.cpp | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'src/shader_recompiler/frontend/maxwell/translate_program.cpp')

diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp
index ed8729fcaf..e728b43cc6 100644
--- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp
@@ -174,14 +174,12 @@ IR::Program MergeDualVertexPrograms(IR::Program& vertex_a, IR::Program& vertex_b
     Optimization::VertexATransformPass(vertex_a);
     Optimization::VertexBTransformPass(vertex_b);
     for (const auto& term : vertex_a.syntax_list) {
-        if (term.type == IR::AbstractSyntaxNode::Type::Return) {
-            continue;
+        if (term.type != IR::AbstractSyntaxNode::Type::Return) {
+            result.syntax_list.push_back(term);
         }
-        result.syntax_list.push_back(term);
-    }
-    for (const auto& term : vertex_b.syntax_list) {
-        result.syntax_list.push_back(term);
     }
+    result.syntax_list.insert(result.syntax_list.end(), vertex_b.syntax_list.begin(),
+                              vertex_b.syntax_list.end());
     result.blocks = GenerateBlocks(result.syntax_list);
     result.post_order_blocks = vertex_b.post_order_blocks;
     for (const auto& block : vertex_a.post_order_blocks) {
-- 
cgit v1.2.3-70-g09d2