Skip to content

Commit

Permalink
remove duplicate dictionary lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored and mmanela committed Jul 8, 2024
1 parent 6db92bc commit 194908c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DiffPlex/Differ.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ private static void BuildPieceHashes(IDictionary<string, int> pieceHash, Modific
string piece = pieces[i];
if (ignoreWhitespace) piece = piece.Trim();

if (pieceHash.ContainsKey(piece))
if (pieceHash.TryGetValue(piece, out var value))
{
data.HashedPieces[i] = pieceHash[piece];
data.HashedPieces[i] = value;
}
else
{
Expand Down

0 comments on commit 194908c

Please sign in to comment.