Skip to content

Commit 7654753

Browse files
author
Kabuto_W
committed
Fix the wrong union of image hashes in multiple folders.
1 parent eededfd commit 7654753

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

SimilarImages/SimilarImages/ImageHash.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,8 @@ public static List<Tuple<string, string, double>> GetSimilarity(
4949
var pairs = GetImageHashes(folderPath, hashEnum);
5050
if (pairs != null)
5151
{
52-
if (imageHashPairs == null)
53-
{
54-
imageHashPairs = pairs;
55-
}
56-
else
57-
{
58-
imageHashPairs.Union(pairs);
59-
}
52+
imageHashPairs = imageHashPairs == null ? pairs :
53+
imageHashPairs.Union(pairs).ToArray();
6054
}
6155
}
6256

0 commit comments

Comments
 (0)