Skip to content

Commit

Permalink
Collection init.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Jan 28, 2025
1 parent 10c8b81 commit d2ec844
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/IKVM.Runtime/Launcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ static string[] Glob(string path)
list.Add(dir != null ? Path.Combine(dir, fsi.Name) : fsi.Name);

if (list.Count == 0)
return new string[] { path };
return [path];

return list.ToArray();
}
catch
{
return new string[] { path };
return [path];
}
}

Expand All @@ -117,7 +117,7 @@ static string[] Glob(string[] paths)
for (var i = 0; i < paths.Length; i++)
{
var path = paths[i];
if (path.IndexOf('*') != -1 || path.IndexOf('?') != -1)
if (path.Contains('*') || path.Contains('?'))
list.AddRange(Glob(path));
else
list.Add(path);
Expand Down

0 comments on commit d2ec844

Please sign in to comment.