Skip to content

Commit f861a80

Browse files
committed
Simplifying logic
1 parent 29ef058 commit f861a80

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Launcher.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ bool InsertLaunchLua(std::vector<std::wstring> &commandLine, std::string &firstL
249249

250250
bool isDevScript(std::wstring scriptPath) {
251251
int finalSlash = scriptPath.find_last_of('\\');
252-
std::wstring folderName = scriptPath.substr(0, finalSlash).substr(scriptPath.substr(0, finalSlash).find_last_of(L'\\') + 1);
252+
int nextToLastSlash = scriptPath.find_last_of(L'\\', finalSlash - 1) + 1;
253+
std::wstring folderName(&scriptPath[nextToLastSlash], &scriptPath[finalSlash]);
253254
return folderName == L"src";
254255
}
255256

0 commit comments

Comments
 (0)