Use is null/is not null

This commit is contained in:
Tyrrrz
2021-03-09 21:57:26 +02:00
parent ebe4d58a42
commit 3aef7faa1e
17 changed files with 59 additions and 59 deletions

View File

@@ -27,11 +27,11 @@ namespace DiscordChatExporter.Core.Markdown.Matching
var match = matcher.TryMatch(stringPart);
// If there's no match - continue
if (match == null)
if (match is null)
continue;
// If this match is earlier than previous earliest - replace
if (earliestMatch == null || match.StringPart.StartIndex < earliestMatch.StringPart.StartIndex)
if (earliestMatch is null || match.StringPart.StartIndex < earliestMatch.StringPart.StartIndex)
earliestMatch = match;
// If the earliest match starts at the very beginning - break,

View File

@@ -21,7 +21,7 @@ namespace DiscordChatExporter.Core.Markdown.Matching
var match = matcher.TryMatch(stringPart.Slice(currentIndex, stringPart.EndIndex - currentIndex));
// If there's no match - break
if (match == null)
if (match is null)
break;
// If this match doesn't start immediately at current index - transform and yield fallback first