static analysis: std::move

This commit is contained in:
Megamouse 2025-03-04 19:43:44 +01:00
parent e8463403f5
commit 6abb863a54
5 changed files with 5 additions and 5 deletions

View file

@ -543,7 +543,7 @@ namespace cfg
std::string def;
string(node* owner, std::string name, std::string def = {}, bool dynamic = false)
: _base(type::string, owner, name, dynamic)
: _base(type::string, owner, std::move(name), dynamic)
, m_value(def)
, def(std::move(def))
{

View file

@ -32,5 +32,5 @@ public:
virtual bool can_consume_frame() const = 0;
virtual void present_frame(std::vector<u8>& data, u32 pitch, u32 width, u32 height, bool is_bgra) const = 0;
virtual void take_screenshot(const std::vector<u8> sshot_data, u32 sshot_width, u32 sshot_height, bool is_bgra) = 0;
virtual void take_screenshot(std::vector<u8>&& sshot_data, u32 sshot_width, u32 sshot_height, bool is_bgra) = 0;
};

View file

@ -7,7 +7,7 @@
struct cfg_ps_move final : cfg::node
{
cfg_ps_move() : cfg::node() {}
cfg_ps_move(cfg::node* owner, std::string name) : cfg::node(owner, name) {}
cfg_ps_move(cfg::node* owner, std::string name) : cfg::node(owner, std::move(name)) {}
cfg::uint<0, 255> r{ this, "Color R", 0, true };
cfg::uint<0, 255> g{ this, "Color G", 0, true };

View file

@ -793,7 +793,7 @@ void gs_frame::present_frame(std::vector<u8>& data, u32 pitch, u32 width, u32 he
video_provider.present_frame(data, pitch, width, height, is_bgra);
}
void gs_frame::take_screenshot(std::vector<u8> data, u32 sshot_width, u32 sshot_height, bool is_bgra)
void gs_frame::take_screenshot(std::vector<u8>&& data, u32 sshot_width, u32 sshot_height, bool is_bgra)
{
std::thread(
[sshot_width, sshot_height, is_bgra](std::vector<u8> sshot_data)

View file

@ -79,7 +79,7 @@ public:
bool can_consume_frame() const override;
void present_frame(std::vector<u8>& data, u32 pitch, u32 width, u32 height, bool is_bgra) const override;
void take_screenshot(std::vector<u8> data, u32 sshot_width, u32 sshot_height, bool is_bgra) override;
void take_screenshot(std::vector<u8>&& data, u32 sshot_width, u32 sshot_height, bool is_bgra) override;
protected:
video_renderer m_renderer;