From 1dc529462908f46e1abfbd1faa33d58aa7fe874e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 31 Jul 2014 22:18:45 -0400 Subject: [PATCH] Common: Simplify StripTailDirSlashes --- Source/Core/Common/FileUtil.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index c06f4601a9..e84bc6c50b 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -59,11 +59,9 @@ static void StripTailDirSlashes(std::string &fname) { if (fname.length() > 1) { - size_t i = fname.length() - 1; - while (fname[i] == DIR_SEP_CHR) - fname[i--] = '\0'; + while (fname.back() == DIR_SEP_CHR) + fname.pop_back(); } - return; } // Returns true if file filename exists