mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #40092 from hinlopen/remove-find-last
Remove String::find_last (same as rfind)
This commit is contained in:
commit
c020eea184
26 changed files with 41 additions and 80 deletions
|
@ -780,7 +780,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
} else if (I->get().ends_with("project.godot")) {
|
||||
String path;
|
||||
String file = I->get();
|
||||
int sep = MAX(file.find_last("/"), file.find_last("\\"));
|
||||
int sep = MAX(file.rfind("/"), file.rfind("\\"));
|
||||
if (sep == -1) {
|
||||
path = ".";
|
||||
} else {
|
||||
|
@ -1992,7 +1992,7 @@ bool Main::start() {
|
|||
local_game_path = "res://" + local_game_path;
|
||||
|
||||
} else {
|
||||
int sep = local_game_path.find_last("/");
|
||||
int sep = local_game_path.rfind("/");
|
||||
|
||||
if (sep == -1) {
|
||||
DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue