Skip to content

Commit 4527b33

Browse files
committed
Code quality
1 parent 58c3b73 commit 4527b33

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ public static string GetPreviousExistingDirectory(Func<string, bool> locationExi
264264
var index = path.LastIndexOf('\\');
265265
if (index > 0 && index < (path.Length - 1))
266266
{
267-
string previousDirectoryPath = path.Substring(0, index + 1);
268-
return locationExists(previousDirectoryPath) ? previousDirectoryPath : "";
267+
string previousDirectoryPath = path[..(index + 1)];
268+
return locationExists(previousDirectoryPath) ? previousDirectoryPath : string.Empty;
269269
}
270270
else
271271
{
272-
return "";
272+
return string.Empty;
273273
}
274274
}
275275

@@ -285,7 +285,7 @@ public static string ReturnPreviousDirectoryIfIncompleteString(string path)
285285
// not full path, get previous level directory string
286286
var indexOfSeparator = path.LastIndexOf('\\');
287287

288-
return path.Substring(0, indexOfSeparator + 1);
288+
return path[..(indexOfSeparator + 1)];
289289
}
290290

291291
return path;

0 commit comments

Comments
 (0)