Skip to content

Commit ce9cde8

Browse files
committed
Uses TryGetWord as suggested by Damien
1 parent 1194245 commit ce9cde8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/SIL.Machine.Morphology.HermitCrab/AnalysisStratumRule.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ public IEnumerable<Word> Apply(Word input)
9393
if (mergeEquivalentAnalyses)
9494
{
9595
Shape shape = mruleOutWord.Shape;
96-
if (shapeWord.ContainsKey(shape))
96+
Word canonicalWord;
97+
if (shapeWord.TryGetValue(shape, out canonicalWord))
9798
{
98-
shapeWord[shape].Alternatives.Add(mruleOutWord);
99+
canonicalWord.Alternatives.Add(mruleOutWord);
99100
continue;
100101
}
101102
shapeWord[shape] = mruleOutWord;

0 commit comments

Comments
 (0)