@@ -8,14 +8,18 @@ public struct WhereEnumerator<TIn, TEnumerator, TFunction> : IStructEnumerator<T
88 where TEnumerator : struct , IStructEnumerator < TIn >
99 {
1010 #region private fields
11+
1112 private TFunction predicate ;
1213 private TEnumerator enumerator ;
14+
1315 #endregion
16+
1417 public WhereEnumerator ( ref TFunction predicate , ref TEnumerator enumerator )
1518 {
1619 this . predicate = predicate ;
1720 this . enumerator = enumerator ;
1821 }
22+
1923 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
2024 public bool MoveNext ( )
2125 {
@@ -29,37 +33,42 @@ public bool MoveNext()
2933
3034 return false ;
3135 }
36+
3237 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
3338 public void Reset ( )
3439 {
3540 enumerator . Reset ( ) ;
3641 }
42+
3743 public readonly TIn Current
3844 {
3945 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
40- get => enumerator . Current ;
46+ get => enumerator . Current ;
4147 }
4248
4349 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
4450 public void Dispose ( )
4551 {
4652 enumerator . Dispose ( ) ;
4753 }
48-
4954 }
50-
55+
5156 public struct WhereEnumerator < TIn , TEnumerator > : IStructEnumerator < TIn >
5257 where TEnumerator : struct , IStructEnumerator < TIn >
5358 {
5459 #region private fields
60+
5561 private Func < TIn , bool > predicate ;
5662 private TEnumerator enumerator ;
63+
5764 #endregion
65+
5866 public WhereEnumerator ( Func < TIn , bool > predicate , ref TEnumerator enumerator )
5967 {
6068 this . predicate = predicate ;
6169 this . enumerator = enumerator ;
6270 }
71+
6372 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
6473 public bool MoveNext ( )
6574 {
@@ -73,23 +82,23 @@ public bool MoveNext()
7382
7483 return false ;
7584 }
85+
7686 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
7787 public void Reset ( )
7888 {
7989 enumerator . Reset ( ) ;
8090 }
91+
8192 public readonly TIn Current
8293 {
8394 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
84- get => enumerator . Current ;
95+ get => enumerator . Current ;
8596 }
8697
8798 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
8899 public void Dispose ( )
89100 {
90101 enumerator . Dispose ( ) ;
91102 }
92-
93103 }
94-
95- }
104+ }
0 commit comments