mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
fix: optimization: PVS-Studio warning V813
Passing large objects by const reference avoids unnecessary copying and enhances efficiency. Reported by: PVS-Studio Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
5b325ac2bc
commit
2c1103307f
42 changed files with 173 additions and 144 deletions
|
|
@ -52,7 +52,7 @@ InventoryBuilder::InventoryBuilder() {
|
|||
|
||||
void InventoryBuilder::addGrid(
|
||||
int cols, int count,
|
||||
glm::vec2 pos,
|
||||
const glm::vec2 &pos,
|
||||
int padding,
|
||||
bool addpanel,
|
||||
const SlotLayout& slotLayout
|
||||
|
|
@ -381,7 +381,7 @@ void InventoryView::setPos(glm::vec2 pos) {
|
|||
Container::setPos(pos - origin);
|
||||
}
|
||||
|
||||
void InventoryView::setOrigin(glm::vec2 origin) {
|
||||
void InventoryView::setOrigin(const glm::vec2 &origin) {
|
||||
this->origin = origin;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ namespace gui {
|
|||
|
||||
virtual void setPos(glm::vec2 pos) override;
|
||||
|
||||
void setOrigin(glm::vec2 origin);
|
||||
void setOrigin(const glm::vec2 &origin);
|
||||
glm::vec2 getOrigin() const;
|
||||
|
||||
void setSelected(int index);
|
||||
|
|
@ -130,7 +130,7 @@ namespace gui {
|
|||
/// @param slotLayout slot settings (index and position are ignored)
|
||||
void addGrid(
|
||||
int cols, int count,
|
||||
glm::vec2 pos,
|
||||
const glm::vec2 &pos,
|
||||
int padding,
|
||||
bool addpanel,
|
||||
const SlotLayout& slotLayout
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue