bug correction. Please do not use begin ( ) from returns of a function without const & s

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3612 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-10-05 15:46:08 +00:00
parent 4db463a4dc
commit a90f332a40
2 changed files with 7 additions and 6 deletions

View File

@ -825,11 +825,12 @@ bool p3Config::getHashAttempt(const std::string& loadHash, std::string& hashstr,
PQInterface *stream = NULL;
std::string tempString, msgConfigFileName;
std::string::reverse_iterator rit = Filename().rbegin();
std::string filename = Filename() ;
std::string::reverse_iterator rit = filename.rbegin();
// get the msgconfig file name
for(int i =0; (i <= 7) && (rit != Filename().rend()); i++)
for(int i =0; (i <= 7) && (rit != filename.rend()); i++)
{
tempString.push_back(*rit);
rit++;
@ -1306,13 +1307,13 @@ uint32_t pqiConfig::Type()
return type;
}
std::string pqiConfig::Filename()
const std::string& pqiConfig::Filename()
{
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
return filename;
}
std::string pqiConfig::Hash()
const std::string& pqiConfig::Hash()
{
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
return hash;

View File

@ -132,13 +132,13 @@ uint32_t Type();
/**
* The name of the configuration file
*/
std::string Filename();
const std::string& Filename();
/**
* The hash computed for this configuration, can use this to compare to externally stored hash
* for validation checking
*/
std::string Hash();
const std::string& Hash();
protected: