回答編集履歴

1

修正

2019/04/27 15:56

投稿

Zuishin
Zuishin

スコア28656

test CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  {
34
34
 
35
- public CustomEqualityComparer(Func<T, T, bool> equals, Func<int> getHashCode = null)
35
+ public CustomEqualityComparer(Func<T, T, bool> equals, Func<T, int> getHashCode = null)
36
36
 
37
37
  {
38
38
 
@@ -42,7 +42,7 @@
42
42
 
43
43
  }
44
44
 
45
- private readonly Func<int> getHashCode;
45
+ private readonly Func<T, int> getHashCode;
46
46
 
47
47
  private readonly Func<T, T, bool> equals;
48
48
 
@@ -62,7 +62,7 @@
62
62
 
63
63
  {
64
64
 
65
- return getHashCode?.Invoke() ?? 0;
65
+ return getHashCode?.Invoke(obj) ?? 0;
66
66
 
67
67
  }
68
68