Skip to content

Commit

Permalink
Pass comparer when instantiating new result set in SortedSet diff ope…
Browse files Browse the repository at this point in the history
…ration (#368)

* Pass comparer when cloning or instantiating new SortedSet dictionary

* nit

---------

Co-authored-by: Tal Zaccai <talzacc@microsoft.com>
  • Loading branch information
PaulusParssinen and TalZaccai authored May 9, 2024
1 parent 88b7db0 commit aef49e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/server/Objects/SortedSet/SortedSetObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ public static Dictionary<byte[], double> CopyDiff(Dictionary<byte[], double> dic
return [];

if (dict2 == null)
return new Dictionary<byte[], double>(dict1);
return new Dictionary<byte[], double>(dict1, dict1.Comparer);

Dictionary<byte[], double> result = [];
var result = new Dictionary<byte[], double>(dict1.Comparer);
foreach (var item in dict1)
{
if (!dict2.ContainsKey(item.Key))
Expand Down

0 comments on commit aef49e1

Please sign in to comment.