1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Add contains_char() for single-character 'contains' calls.

This commit is contained in:
Lukas Tenbrink
2024-12-05 17:56:08 +01:00
parent eb5103093c
commit b5c31ebb41
61 changed files with 108 additions and 99 deletions

View File

@@ -47,7 +47,7 @@ private:
_FORCE_INLINE_ bool is_valid_path(const String &p_path) const {
// If path contains \, it's a Windows path, so we need to convert it to /, and check as case-insensitive.
if (p_path.contains("\\")) {
if (p_path.contains_char('\\')) {
String project_path = ProjectSettings::get_singleton()->get_resource_path();
String path = p_path.replace("\\", "/");
return path.containsn(project_path);