From 4e3671fd46e54a96dd4f8e360ab127e3662a688c Mon Sep 17 00:00:00 2001 From: Martin van Zijl Date: Wed, 1 Apr 2020 22:15:11 +1300 Subject: [PATCH] Use npos instead of -1. Remove second comment. --- toonz/sources/common/tsystem/tfilepath.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toonz/sources/common/tsystem/tfilepath.cpp b/toonz/sources/common/tsystem/tfilepath.cpp index 032f5f7a..862c5ac4 100644 --- a/toonz/sources/common/tsystem/tfilepath.cpp +++ b/toonz/sources/common/tsystem/tfilepath.cpp @@ -606,8 +606,7 @@ std::string TFilePath::getLevelName() const { } //----------------------------------------------------------------------------- -// es. TFilePath("/pippo/pluto.0001.tif").getLevelName() == "pluto..tif" -// es. TFilePath("/pippo/0001.tif").getLevelName() == "0001.tif" +// es. TFilePath("/pippo/pluto.0001.gif").getLevelName() == "pluto..gif" std::wstring TFilePath::getLevelNameW() const { int i = getLastSlash(m_path); // cerco l'ultimo slash @@ -623,7 +622,8 @@ std::wstring TFilePath::getLevelNameW() const { if (j == i || j - i == 1) // prova.tif o prova..tif return str; - if (!checkForSeqNum(type) || !isNumbers(str, i, j) || i == -1) return str; + if (!checkForSeqNum(type) || !isNumbers(str, i, j) || + i == (int)std::wstring::npos) return str; // prova.0001.tif return str.erase(i + 1, j - i - 1); }