This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (pattern is IPatternWithDesignation withDesignation) | |
{ | |
var existingDesignation = withDesignation.Designation; | |
if (existingDesignation != null && !(existingDesignation is IDiscardDesignation)) return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// after "Merge sequential patterns" | |
if (pattern is IPatternWithDesignation withDesignation) | |
{ | |
var existingDesignation = withDesignation.Designation; | |
if (existingDesignation is { } and not IDiscardDesignation) return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// after "Replace `and` with `or`" | |
if (pattern is IPatternWithDesignation withDesignation) | |
{ | |
var existingDesignation = withDesignation.Designation; | |
if (existingDesignation is not (null or IDiscardDesignation)) return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inline variable, merge ifs, merge sequential patterns into recursive | |
if (pattern is IPatternWithDesignation { Designation: not (null or IDiscardDesignation) }) | |
return false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment