From 8e0bd85107f57e900658129f9cfbded0866f0883 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 16 May 2017 22:41:56 +0300 Subject: Improve a bit subDir empty check in virtfs. --- src/fs/virtfs/fszip.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/fs/virtfs/fszip.cpp') diff --git a/src/fs/virtfs/fszip.cpp b/src/fs/virtfs/fszip.cpp index 068b7ee45..d70df7749 100644 --- a/src/fs/virtfs/fszip.cpp +++ b/src/fs/virtfs/fszip.cpp @@ -95,7 +95,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast(entry); std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) { filename = pathJoin(subDir, filename); dirName = pathJoin(subDir, dirName); @@ -129,7 +129,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast(entry); std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) { filename = pathJoin(subDir, filename); dirName = pathJoin(subDir, dirName); @@ -157,7 +157,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast(entry); const std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) dirName = pathJoin(subDir, dirName); if (dirName == dirSeparator) { @@ -220,7 +220,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast(entry); const std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) dirName = pathJoin(subDir, dirName); if (dirName == dirSeparator) { @@ -319,7 +319,7 @@ namespace FsZip ZipEntry *const zipEntry = static_cast(entry); const std::string subDir = zipEntry->subDir; std::string dirNameFull; - if (subDir != dirSeparator) + if (!subDir.empty()) dirNameFull = pathJoin(subDir, dirName); else dirNameFull = dirName; @@ -419,7 +419,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast(entry); const std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) dirName = pathJoin(subDir, dirName); if (dirName == dirSeparator) { @@ -517,7 +517,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast(entry); std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) dirName = pathJoin(subDir, dirName); FOR_EACH (std::vector::const_iterator, it2, @@ -542,7 +542,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast(entry); std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) filename = pathJoin(subDir, filename); FOR_EACH (std::vector::const_iterator, it2, @@ -675,7 +675,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast(entry); const std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) filename = pathJoin(subDir, filename); FOR_EACH (std::vector::const_iterator, it2, -- cgit v1.2.3-70-g09d2