diff --git a/src/NotesLoader.cpp b/src/NotesLoader.cpp index 3361da0363..27e88e951c 100644 --- a/src/NotesLoader.cpp +++ b/src/NotesLoader.cpp @@ -11,23 +11,24 @@ #include #include - void NotesLoader::GetMainAndSubTitlesFromFullTitle( const RString &sFullTitle, RString &sMainTitleOut, RString &sSubTitleOut ) { - const RString sLeftSeps[] = { "\t", " -", " ~", " (", " [" }; + static const std::string_view sLeftSeps[] = { "\t", " -", " ~", " (", " [" }; + size_t fullTitleSize = sFullTitle.size(); - for( unsigned i=0; i(iBeginIndex)); + sSubTitleOut = sFullTitle.substr(iBeginIndex + sep.size(), fullTitleSize - iBeginIndex - sep.size()); + return; + } } sMainTitleOut = sFullTitle; sSubTitleOut = ""; -}; +} bool NotesLoader::LoadFromDir( const RString &sPath, Song &out, std::set &BlacklistedImages, bool load_autosave ) {