diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-08-12 21:54:36 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-08-12 21:56:19 +0200 |
commit | bdc14e11430b6c6538e6a2c721d22dabe83487e3 (patch) | |
tree | d4af54f13591590244b6063b99d78ae50861cb15 /src/resources | |
parent | bcfe75f0934a5a994c4c49df34eca6ee8ef68e6a (diff) | |
download | mana-bdc14e11430b6c6538e6a2c721d22dabe83487e3.tar.gz mana-bdc14e11430b6c6538e6a2c721d22dabe83487e3.tar.bz2 mana-bdc14e11430b6c6538e6a2c721d22dabe83487e3.tar.xz mana-bdc14e11430b6c6538e6a2c721d22dabe83487e3.zip |
Avoid string copy for SpriteDef::getAction
Pass std::string as const & when it makes sense.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/spritedef.cpp | 2 | ||||
-rw-r--r-- | src/resources/spritedef.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 97c9ab48..311c9d1a 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -39,7 +39,7 @@ SpriteReference *SpriteReference::Empty = new SpriteReference( paths.getStringValue("spriteErrorFile"), 0); -Action *SpriteDef::getAction(std::string action) const +Action *SpriteDef::getAction(const std::string &action) const { Actions::const_iterator i = mActions.find(action); diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index 70ad6ed6..18a70c9b 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -104,7 +104,7 @@ class SpriteDef : public Resource /** * Returns the specified action. */ - Action *getAction(std::string action) const; + Action *getAction(const std::string &action) const; /** * Converts a string into a SpriteDirection enum. |