Use reference instead of copy.

This commit is contained in:
hiker 2017-04-23 00:48:31 +10:00
parent de795b766a
commit 1d7aa7a2f5
2 changed files with 2 additions and 3 deletions

View File

@ -265,9 +265,8 @@ std::vector<std::string> Steam::getFriends()
* filename. Note that the avatar is always saved in png format (independent * filename. Note that the avatar is always saved in png format (independent
* on what is specified as filename). * on what is specified as filename).
*/ */
int Steam::saveAvatarAs(const std::string filename) int Steam::saveAvatarAs(const std::string &filename)
{ {
//std::string s = sendCommand(std::string("avatar ")+filename);
std::string s = sendCommand("avatar"); std::string s = sendCommand("avatar");
if(s=="filename") if(s=="filename")
s=sendCommand(filename); s=sendCommand(filename);

View File

@ -61,7 +61,7 @@ public:
~Steam(); ~Steam();
const std::string& getUserName(); const std::string& getUserName();
const std::string& getSteamID(); const std::string& getSteamID();
int saveAvatarAs(const std::string filename); int saveAvatarAs(const std::string &filename);
std::vector<std::string> getFriends(); std::vector<std::string> getFriends();
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** Returns true if the connection to the Steam API was successful, i.e. /** Returns true if the connection to the Steam API was successful, i.e.