Use rvalue where necessary and const where used

This commit is contained in:
dcvz 2024-05-14 02:46:17 +02:00
parent 14f60f3520
commit ae5c0e2553

View file

@ -44,7 +44,7 @@ namespace RecompPort {
std::string func_name;
uint32_t size_bytes;
FunctionSize(std::string func_name, uint32_t size_bytes) : func_name(std::move(func_name)), size_bytes(size_bytes) {}
FunctionSize(const std::string& func_name, uint32_t size_bytes) : func_name(func_name), size_bytes(size_bytes) {}
};
struct ManualFunction {
@ -53,7 +53,7 @@ namespace RecompPort {
uint32_t vram;
uint32_t size;
ManualFunction(std::string func_name, std::string section_name, uint32_t vram, uint32_t size) : func_name(std::move(func_name)), section_name(std::move(section_name)), vram(vram), size(size) {}
ManualFunction(const std::string& func_name, std::string section_name, uint32_t vram, uint32_t size) : func_name(func_name), section_name(std::move(section_name)), vram(vram), size(size) {}
};
struct Config {
@ -88,7 +88,7 @@ namespace RecompPort {
uint32_t jr_vram;
std::vector<uint32_t> entries;
JumpTable(uint32_t vram, uint32_t addend_reg, uint32_t rom, uint32_t lw_vram, uint32_t addu_vram, uint32_t jr_vram, std::vector<uint32_t> entries)
JumpTable(uint32_t vram, uint32_t addend_reg, uint32_t rom, uint32_t lw_vram, uint32_t addu_vram, uint32_t jr_vram, std::vector<uint32_t>&& entries)
: vram(vram), addend_reg(addend_reg), rom(rom), lw_vram(lw_vram), addu_vram(addu_vram), jr_vram(jr_vram), entries(std::move(entries)) {}
};