Skip to content

Commit 55ac62f

Browse files
committed
Fix 'count' confusion
1 parent 46be1c0 commit 55ac62f

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/SIL.Machine/PunctuationAnalysis/QuotationMarkTabulator.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,22 @@ public void Tabulate(List<QuotationMarkMetadata> quotationMarks)
7373
public void TabulateFrom(QuotationMarkTabulator tabulatedQuotationMarks)
7474
{
7575
foreach (
76-
KeyValuePair<
77-
(int, QuotationMarkDirection),
78-
QuotationMarkCounts
79-
> kvp in tabulatedQuotationMarks._quotationCountsByDepthAndDirection
76+
(
77+
(int depth, QuotationMarkDirection direction),
78+
QuotationMarkCounts otherCounts
79+
) in tabulatedQuotationMarks._quotationCountsByDepthAndDirection.Select(kvp => (kvp.Key, kvp.Value))
8080
)
8181
{
82-
((int depth, QuotationMarkDirection direction), QuotationMarkCounts counts) = (kvp.Key, kvp.Value);
83-
if (!_quotationCountsByDepthAndDirection.TryGetValue((depth, direction), out QuotationMarkCounts count))
82+
if (
83+
!_quotationCountsByDepthAndDirection.TryGetValue(
84+
(depth, direction),
85+
out QuotationMarkCounts currentCounts
86+
)
87+
)
8488
{
85-
_quotationCountsByDepthAndDirection[(depth, direction)] = new QuotationMarkCounts();
89+
currentCounts = new QuotationMarkCounts();
8690
}
87-
counts.CountFrom(counts);
91+
currentCounts.CountFrom(otherCounts);
8892
}
8993
}
9094

0 commit comments

Comments
 (0)