Use .NET 9

This commit is contained in:
Tyrrrz
2024-11-12 22:19:58 +02:00
parent 7b892c8e5b
commit 0fa5e93f0d
4 changed files with 9 additions and 10 deletions

View File

@@ -3,12 +3,9 @@
namespace DiscordChatExporter.Core.Markdown.Parsing;
internal class AggregateMatcher<TContext, TValue>(
IReadOnlyList<IMatcher<TContext, TValue>> matchers
params IReadOnlyList<IMatcher<TContext, TValue>> matchers
) : IMatcher<TContext, TValue>
{
public AggregateMatcher(params IMatcher<TContext, TValue>[] matchers)
: this((IReadOnlyList<IMatcher<TContext, TValue>>)matchers) { }
public ParsedMatch<TValue>? TryMatch(TContext context, StringSegment segment)
{
ParsedMatch<TValue>? earliestMatch = null;
@@ -28,7 +25,9 @@ internal class AggregateMatcher<TContext, TValue>(
earliestMatch is null
|| match.Segment.StartIndex < earliestMatch.Segment.StartIndex
)
{
earliestMatch = match;
}
// If the earliest match starts at the very beginning - break,
// because it's impossible to find a match earlier than that