mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 07:45:33 +01:00
GraphicsModGroup: Reduce object churn
We can emplace and move to avoid doing object copies.
This commit is contained in:
parent
e3e20df185
commit
0327b11e0b
@ -18,7 +18,7 @@
|
|||||||
#include "VideoCommon/GraphicsModSystem/Constants.h"
|
#include "VideoCommon/GraphicsModSystem/Constants.h"
|
||||||
#include "VideoCommon/HiresTextures.h"
|
#include "VideoCommon/HiresTextures.h"
|
||||||
|
|
||||||
GraphicsModGroupConfig::GraphicsModGroupConfig(const std::string& game_id) : m_game_id(game_id)
|
GraphicsModGroupConfig::GraphicsModGroupConfig(std::string game_id) : m_game_id(std::move(game_id))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,9 +145,9 @@ void GraphicsModGroupConfig::Save() const
|
|||||||
{
|
{
|
||||||
picojson::object serialized_mod;
|
picojson::object serialized_mod;
|
||||||
mod.SerializeToProfile(&serialized_mod);
|
mod.SerializeToProfile(&serialized_mod);
|
||||||
serialized_mods.push_back(picojson::value{serialized_mod});
|
serialized_mods.emplace_back(std::move(serialized_mod));
|
||||||
}
|
}
|
||||||
serialized_root["mods"] = picojson::value{serialized_mods};
|
serialized_root.emplace("mods", std::move(serialized_mods));
|
||||||
|
|
||||||
const auto output = picojson::value{serialized_root}.serialize(true);
|
const auto output = picojson::value{serialized_root}.serialize(true);
|
||||||
json_stream << output;
|
json_stream << output;
|
||||||
|
@ -16,7 +16,7 @@ struct GraphicsModConfig;
|
|||||||
class GraphicsModGroupConfig
|
class GraphicsModGroupConfig
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit GraphicsModGroupConfig(const std::string& game_id);
|
explicit GraphicsModGroupConfig(std::string game_id);
|
||||||
~GraphicsModGroupConfig();
|
~GraphicsModGroupConfig();
|
||||||
|
|
||||||
GraphicsModGroupConfig(const GraphicsModGroupConfig&);
|
GraphicsModGroupConfig(const GraphicsModGroupConfig&);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user