From bdc14e11430b6c6538e6a2c721d22dabe83487e3 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Thu, 12 Aug 2010 21:54:36 +0200 Subject: Avoid string copy for SpriteDef::getAction Pass std::string as const & when it makes sense. --- src/resources/spritedef.cpp | 2 +- src/resources/spritedef.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/resources') 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. -- cgit v1.2.3-70-g09d2