Misc syntax improvements

This commit is contained in:
Archi
2023-08-10 21:36:17 +02:00
parent 837e4bde8f
commit c84366f9ba
6 changed files with 13 additions and 4 deletions

View File

@@ -112,7 +112,7 @@ public static class Utilities {
public static void InBackground<T>(Func<T> function, bool longRunning = false) {
ArgumentNullException.ThrowIfNull(function);
InBackground(void() => function(), longRunning);
InBackground(void () => function(), longRunning);
}
[PublicAPI]

View File

@@ -584,8 +584,6 @@ internal static class Program {
bool networkGroupNext = false;
bool pathNext = false;
bool noArgumentValueNext() => !cryptKeyNext && !cryptKeyFileNext && !networkGroupNext && !pathNext;
foreach (string arg in args) {
switch (arg.ToUpperInvariant()) {
case "--CRYPTKEY" when noArgumentValueNext():
@@ -697,6 +695,8 @@ internal static class Program {
}
return true;
bool noArgumentValueNext() => !cryptKeyNext && !cryptKeyFileNext && !networkGroupNext && !pathNext;
}
private static async Task<bool> ParseEnvironmentVariables() {

View File

@@ -166,7 +166,7 @@ internal static class GitHub {
MarkdownDocument markdownDocument = Markdown.Parse(markdownText);
MarkdownDocument result = new();
foreach (Block block in markdownDocument.SkipWhile(static block => block is not HeadingBlock { Inline.FirstChild: LiteralInline literalInline } || !literalInline.Content.ToString().Equals("Changelog", StringComparison.OrdinalIgnoreCase)).Skip(1).TakeWhile(static block => block is not ThematicBreakBlock).ToList()) {
foreach (Block block in markdownDocument.SkipWhile(static block => block is not HeadingBlock { Inline.FirstChild: LiteralInline literalInline } || (literalInline.Content.ToString()?.Equals("Changelog", StringComparison.OrdinalIgnoreCase) != true)).Skip(1).TakeWhile(static block => block is not ThematicBreakBlock).ToList()) {
// All blocks that we're interested in must be removed from original markdownDocument firstly
markdownDocument.Remove(block);
result.Add(block);