diff options
author | Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com> | 2021-09-03 18:44:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-03 18:44:36 +0200 |
commit | ade4e9320a6ca403b8053fe5828d3f9ce809338c (patch) | |
tree | 38663e7c6a31035e0f3caf28590bacf9824f6a02 /modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs | |
parent | c3591a9b04f3cc62d5ea4fe13228979b0200cce3 (diff) | |
parent | 1933df00138618c9004b6a6343e2f983df58bd3c (diff) | |
download | redot-engine-ade4e9320a6ca403b8053fe5828d3f9ce809338c.tar.gz |
Merge pull request #50872 from aaronfranke/cs-format-mini-2
Some more C# formatting and style fixes
Diffstat (limited to 'modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs')
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs index b217ae4bf7..60a4f297c9 100644 --- a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs +++ b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs @@ -7,6 +7,8 @@ namespace GodotTools.Core { public static class StringExtensions { + private static readonly string _driveRoot = Path.GetPathRoot(Environment.CurrentDirectory); + public static string RelativeToPath(this string path, string dir) { // Make sure the directory ends with a path separator @@ -49,13 +51,11 @@ namespace GodotTools.Core return Path.DirectorySeparatorChar + path; } - private static readonly string DriveRoot = Path.GetPathRoot(Environment.CurrentDirectory); - public static bool IsAbsolutePath(this string path) { return path.StartsWith("/", StringComparison.Ordinal) || path.StartsWith("\\", StringComparison.Ordinal) || - path.StartsWith(DriveRoot, StringComparison.Ordinal); + path.StartsWith(_driveRoot, StringComparison.Ordinal); } public static string ToSafeDirName(this string dirName, bool allowDirSeparator = false) |