mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-12-25 01:11:48 +01:00
Merge pull request #580 from lioncash/emplace
core/video_core: Use in-place construction where possible
This commit is contained in:
commit
ec8f2210e3
@ -129,7 +129,7 @@ static void FreeTsEvent(Event* event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int RegisterEvent(const char* name, TimedCallback callback) {
|
int RegisterEvent(const char* name, TimedCallback callback) {
|
||||||
event_types.push_back(EventType(callback, name));
|
event_types.emplace_back(callback, name);
|
||||||
return (int)event_types.size() - 1;
|
return (int)event_types.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (it == output_info_table.end()) {
|
if (it == output_info_table.end()) {
|
||||||
output_info_table.push_back({});
|
output_info_table.emplace_back();
|
||||||
output_info_table.back().type = type;
|
output_info_table.back().type = type;
|
||||||
output_info_table.back().component_mask = component_mask;
|
output_info_table.back().component_mask = component_mask;
|
||||||
output_info_table.back().id = i;
|
output_info_table.back().id = i;
|
||||||
@ -285,7 +285,7 @@ void OnPicaRegWrite(u32 id, u32 value)
|
|||||||
if (!is_pica_tracing)
|
if (!is_pica_tracing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pica_trace->writes.push_back({id, value});
|
pica_trace->writes.emplace_back(id, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<PicaTrace> FinishPicaTracing()
|
std::unique_ptr<PicaTrace> FinishPicaTracing()
|
||||||
|
@ -58,8 +58,8 @@ public:
|
|||||||
if (observers.empty())
|
if (observers.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gx_command_history.push_back(GSP_GPU::Command());
|
gx_command_history.emplace_back();
|
||||||
GSP_GPU::Command& cmd = gx_command_history[gx_command_history.size()-1];
|
GSP_GPU::Command& cmd = gx_command_history.back();
|
||||||
|
|
||||||
memcpy(&cmd, command_data, sizeof(GSP_GPU::Command));
|
memcpy(&cmd, command_data, sizeof(GSP_GPU::Command));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user