Improve/cleanup Path::removeQuotationMarks().

This commit is contained in:
Lieven de Cock 2011-03-30 21:46:41 +03:00 committed by Kimmo Varis
parent ae2a8d839b
commit 97328f08de
1 changed files with 1 additions and 10 deletions

View File

@ -124,16 +124,7 @@ bool Path::sameFileName(const std::string &fname1, const std::string &fname2)
std::string Path::removeQuotationMarks(const std::string &path)
{
size_t pos = path.length() - 1;
std::string editPath(path);
while (pos != std::string::npos)
{
pos = editPath.rfind('\"', pos);
if (pos != std::string::npos)
{
editPath.erase(pos, 1);
--pos;
}
}
editPath.erase(std::remove(editPath.begin(), editPath.end(), '\"'), editPath.end());
return editPath;
}