Skip to content

Commit c8aac33

Browse files
committed
Use ternary operator
1 parent 6059ce2 commit c8aac33

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

Rubberduck.RegexAssistant/VBRegexParser.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,9 @@ public static IRegularExpression Parse(string specifier, bool spellOutWhiteSpace
7878
private static string DescendLiteral(string specifier)
7979
{
8080
var matcher = LITERAL_PATTERN.Match(specifier);
81-
if (matcher.Success)
82-
{
83-
return matcher.Groups["expression"].Value;
84-
}
85-
return string.Empty;
81+
return matcher.Success
82+
? matcher.Groups["expression"].Value
83+
: string.Empty;
8684
}
8785

8886
private static string DescendClass(string specifier)
@@ -94,11 +92,9 @@ private static string GetQuantifier(string specifier, int length)
9492
{
9593
var operationalSubstring = specifier.Substring(length);
9694
var matcher = QUANTIFIER_PATTERN.Match(operationalSubstring);
97-
if (matcher.Success)
98-
{
99-
return matcher.Groups["quantifier"].Value;
100-
}
101-
return string.Empty;
95+
return matcher.Success
96+
? matcher.Groups["quantifier"].Value
97+
: string.Empty;
10298
}
10399

104100
private static string DescendGroup(string specifier)

0 commit comments

Comments
 (0)