aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-05-27 11:45:40 +0200
committerest31 <MTest31@outlook.com>2015-05-27 11:45:40 +0200
commit21878c9d5c364faa1f43c84c51804d9b7dbe376f (patch)
tree0f7c383eeb95dbbaf57e10875a6625e7b21bbed8
parentf16ebbfecf89131b81625ef734c6607c5684c2bd (diff)
downloadminetest-21878c9d5c364faa1f43c84c51804d9b7dbe376f.tar.gz
minetest-21878c9d5c364faa1f43c84c51804d9b7dbe376f.tar.bz2
minetest-21878c9d5c364faa1f43c84c51804d9b7dbe376f.zip
Spare some string copies
-rw-r--r--src/content_sao.cpp8
-rw-r--r--src/content_sao.h8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index 1f7323c9c..b644bdff7 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -541,13 +541,13 @@ void LuaEntitySAO::setAnimation(v2f frame_range, float frame_speed, float frame_
m_animation_sent = false;
}
-void LuaEntitySAO::setBonePosition(std::string bone, v3f position, v3f rotation)
+void LuaEntitySAO::setBonePosition(const std::string &bone, v3f position, v3f rotation)
{
m_bone_position[bone] = core::vector2d<v3f>(position, rotation);
m_bone_position_sent = false;
}
-void LuaEntitySAO::setAttachment(int parent_id, std::string bone, v3f position, v3f rotation)
+void LuaEntitySAO::setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation)
{
// Attachments need to be handled on both the server and client.
// If we just attach on the server, we can only copy the position of the parent. Attachments
@@ -1142,14 +1142,14 @@ void PlayerSAO::setAnimation(v2f frame_range, float frame_speed, float frame_ble
m_animation_sent = false;
}
-void PlayerSAO::setBonePosition(std::string bone, v3f position, v3f rotation)
+void PlayerSAO::setBonePosition(const std::string &bone, v3f position, v3f rotation)
{
// store these so they can be updated to clients
m_bone_position[bone] = core::vector2d<v3f>(position, rotation);
m_bone_position_sent = false;
}
-void PlayerSAO::setAttachment(int parent_id, std::string bone, v3f position, v3f rotation)
+void PlayerSAO::setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation)
{
// Attachments need to be handled on both the server and client.
// If we just attach on the server, we can only copy the position of the parent. Attachments
diff --git a/src/content_sao.h b/src/content_sao.h
index 4a8c70e16..05b5fa7e1 100644
--- a/src/content_sao.h
+++ b/src/content_sao.h
@@ -59,8 +59,8 @@ public:
s16 getHP() const;
void setArmorGroups(const ItemGroupList &armor_groups);
void setAnimation(v2f frame_range, float frame_speed, float frame_blend);
- void setBonePosition(std::string bone, v3f position, v3f rotation);
- void setAttachment(int parent_id, std::string bone, v3f position, v3f rotation);
+ void setBonePosition(const std::string &bone, v3f position, v3f rotation);
+ void setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation);
ObjectProperties* accessObjectProperties();
void notifyObjectPropertiesModified();
/* LuaEntitySAO-specific */
@@ -193,8 +193,8 @@ public:
void setBreath(u16 breath);
void setArmorGroups(const ItemGroupList &armor_groups);
void setAnimation(v2f frame_range, float frame_speed, float frame_blend);
- void setBonePosition(std::string bone, v3f position, v3f rotation);
- void setAttachment(int parent_id, std::string bone, v3f position, v3f rotation);
+ void setBonePosition(const std::string &bone, v3f position, v3f rotation);
+ void setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation);
ObjectProperties* accessObjectProperties();
void notifyObjectPropertiesModified();
void setNametagColor(video::SColor color);