mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Optimize parameter passing to avoid unnecessary copying
This commit is contained in:
parent
46ca1bb04a
commit
f25a425cb9
123 changed files with 578 additions and 522 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#include "Block.hpp"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "../core_defs.hpp"
|
||||
#include "../util/stringutil.hpp"
|
||||
|
||||
|
|
@ -38,7 +40,7 @@ const BlockRotProfile BlockRotProfile::PANE {"pane", {
|
|||
{ { 0, 0, 1 }, { 0, 1, 0 }, {-1, 0, 0 }}, // West
|
||||
}};
|
||||
|
||||
Block::Block(std::string name)
|
||||
Block::Block(const std::string& name)
|
||||
: name(name),
|
||||
caption(util::id_to_caption(name)),
|
||||
textureFaces {TEXTURE_NOTFOUND,TEXTURE_NOTFOUND,TEXTURE_NOTFOUND,
|
||||
|
|
@ -46,7 +48,7 @@ Block::Block(std::string name)
|
|||
rotations(BlockRotProfile::PIPE)
|
||||
{}
|
||||
|
||||
Block::Block(std::string name, std::string texture) : name(name),
|
||||
Block::Block(std::string name, const std::string& texture) : name(std::move(name)),
|
||||
textureFaces{texture,texture,texture,texture,texture,texture},
|
||||
rotations(BlockRotProfile::PIPE)
|
||||
{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue