|
1 | | -using System.Collections; |
| 1 | +using System.Collections; |
2 | 2 | using System.Collections.Generic; |
| 3 | +using System.Linq; |
3 | 4 |
|
4 | 5 | namespace Lucene.Net.Support |
5 | 6 | { |
@@ -43,25 +44,25 @@ public CastingSetAdapter(ISet<T> set) |
43 | 44 |
|
44 | 45 | void ICollection<U>.Add(U item) => set.Add(((T)item)!); |
45 | 46 |
|
46 | | - public void UnionWith(IEnumerable<U> other) => set.UnionWith((IEnumerable<T>)other); |
| 47 | + public void UnionWith(IEnumerable<U> other) => set.UnionWith(other.Cast<T>()); |
47 | 48 |
|
48 | | - public void IntersectWith(IEnumerable<U> other) => set.IntersectWith((IEnumerable<T>)other); |
| 49 | + public void IntersectWith(IEnumerable<U> other) => set.IntersectWith(other.Cast<T>()); |
49 | 50 |
|
50 | | - public void ExceptWith(IEnumerable<U> other) => set.ExceptWith((IEnumerable<T>)other); |
| 51 | + public void ExceptWith(IEnumerable<U> other) => set.ExceptWith(other.Cast<T>()); |
51 | 52 |
|
52 | | - public void SymmetricExceptWith(IEnumerable<U> other) => set.SymmetricExceptWith((IEnumerable<T>)other); |
| 53 | + public void SymmetricExceptWith(IEnumerable<U> other) => set.SymmetricExceptWith(other.Cast<T>()); |
53 | 54 |
|
54 | | - public bool IsSubsetOf(IEnumerable<U> other) => set.IsSubsetOf((IEnumerable<T>)other); |
| 55 | + public bool IsSubsetOf(IEnumerable<U> other) => set.IsSubsetOf(other.Cast<T>()); |
55 | 56 |
|
56 | | - public bool IsSupersetOf(IEnumerable<U> other) => set.IsSupersetOf((IEnumerable<T>)other); |
| 57 | + public bool IsSupersetOf(IEnumerable<U> other) => set.IsSupersetOf(other.Cast<T>()); |
57 | 58 |
|
58 | | - public bool IsProperSupersetOf(IEnumerable<U> other) => set.IsProperSupersetOf((IEnumerable<T>)other); |
| 59 | + public bool IsProperSupersetOf(IEnumerable<U> other) => set.IsProperSupersetOf(other.Cast<T>()); |
59 | 60 |
|
60 | | - public bool IsProperSubsetOf(IEnumerable<U> other) => set.IsProperSubsetOf((IEnumerable<T>)other); |
| 61 | + public bool IsProperSubsetOf(IEnumerable<U> other) => set.IsProperSubsetOf(other.Cast<T>()); |
61 | 62 |
|
62 | | - public bool Overlaps(IEnumerable<U> other) => set.Overlaps((IEnumerable<T>)other); |
| 63 | + public bool Overlaps(IEnumerable<U> other) => set.Overlaps(other.Cast<T>()); |
63 | 64 |
|
64 | | - public bool SetEquals(IEnumerable<U> other) => set.SetEquals((IEnumerable<T>)other); |
| 65 | + public bool SetEquals(IEnumerable<U> other) => set.SetEquals(other.Cast<T>()); |
65 | 66 |
|
66 | 67 | bool ISet<U>.Add(U item) => set.Add((T)item); |
67 | 68 |
|
|
0 commit comments