Common: Simplify StripTailDirSlashes

This commit is contained in:
Lioncash 2014-07-31 22:18:45 -04:00
parent 5516b0382c
commit 1dc5294629
1 changed files with 2 additions and 4 deletions

View File

@ -59,11 +59,9 @@ static void StripTailDirSlashes(std::string &fname)
{ {
if (fname.length() > 1) if (fname.length() > 1)
{ {
size_t i = fname.length() - 1; while (fname.back() == DIR_SEP_CHR)
while (fname[i] == DIR_SEP_CHR) fname.pop_back();
fname[i--] = '\0';
} }
return;
} }
// Returns true if file filename exists // Returns true if file filename exists