Skip to content

Commit 46be1c0

Browse files
committed
Use TryGetValue
1 parent f3a94f8 commit 46be1c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SIL.Machine/PunctuationAnalysis/QuotationMarkTabulator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ public void TabulateFrom(QuotationMarkTabulator tabulatedQuotationMarks)
8080
)
8181
{
8282
((int depth, QuotationMarkDirection direction), QuotationMarkCounts counts) = (kvp.Key, kvp.Value);
83-
if (!_quotationCountsByDepthAndDirection.ContainsKey((depth, direction)))
83+
if (!_quotationCountsByDepthAndDirection.TryGetValue((depth, direction), out QuotationMarkCounts count))
8484
{
8585
_quotationCountsByDepthAndDirection[(depth, direction)] = new QuotationMarkCounts();
8686
}
87-
_quotationCountsByDepthAndDirection[(depth, direction)].CountFrom(counts);
87+
counts.CountFrom(counts);
8888
}
8989
}
9090

0 commit comments

Comments
 (0)