Skip to content

Commit 194908c

Browse files
SimonCroppmmanela
authored andcommitted
remove duplicate dictionary lookup
1 parent 6db92bc commit 194908c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DiffPlex/Differ.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ private static void BuildPieceHashes(IDictionary<string, int> pieceHash, Modific
341341
string piece = pieces[i];
342342
if (ignoreWhitespace) piece = piece.Trim();
343343

344-
if (pieceHash.ContainsKey(piece))
344+
if (pieceHash.TryGetValue(piece, out var value))
345345
{
346-
data.HashedPieces[i] = pieceHash[piece];
346+
data.HashedPieces[i] = value;
347347
}
348348
else
349349
{

0 commit comments

Comments
 (0)