Skip to content

Commit dd02ad3

Browse files
Refactor
1 parent babffe9 commit dd02ad3

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,16 @@ public static bool IsLocationPathString(this string querySearchString)
208208
///</summary>
209209
public static string GetPreviousExistingDirectory(Func<string, bool> locationExists, string path)
210210
{
211-
var previousDirectoryPath = "";
212211
var index = path.LastIndexOf('\\');
213212
if (index > 0 && index < (path.Length - 1))
214213
{
215-
previousDirectoryPath = path.Substring(0, index + 1);
216-
if (!locationExists(previousDirectoryPath))
217-
{
218-
return "";
219-
}
214+
string previousDirectoryPath = path.Substring(0, index + 1);
215+
return locationExists(previousDirectoryPath) ? previousDirectoryPath : "";
220216
}
221217
else
222218
{
223219
return "";
224220
}
225-
226-
return previousDirectoryPath;
227221
}
228222

229223
///<summary>

0 commit comments

Comments
 (0)