From 622830f4e16a8f0eabeb1b81dea5fca613402d8c Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Sun, 12 Jul 2020 05:05:04 -0300 Subject: maxwell_3d: Use insert instead of loop push_back This reduces the overhead of bounds checking on each element. It won't reduce the cost of allocation because usually this vector's capacity is usually large enough to hold whatever we push to it. --- src/video_core/engines/maxwell_3d.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/video_core/engines') diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index f7fa5fea7..6287df633 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -132,9 +132,7 @@ void Maxwell3D::ProcessMacro(u32 method, const u32* base_start, u32 amount, bool executing_macro = method; } - for (std::size_t i = 0; i < amount; i++) { - macro_params.push_back(base_start[i]); - } + macro_params.insert(macro_params.end(), base_start, base_start + amount); // Call the macro when there are no more parameters in the command buffer if (is_last_call) { -- cgit v1.2.3