55using System . Collections . Immutable ;
66using System . Diagnostics . CodeAnalysis ;
77using System . Linq ;
8+ using System . Runtime . CompilerServices ;
89using System . Threading ;
910
1011namespace Open . Collections . Synchronized ;
@@ -37,6 +38,9 @@ protected override void OnDispose()
3738 Nullify ( ref InternalSource ) ; // Eliminate risk from wrapper.
3839 }
3940
41+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
42+ private bool AssertIsAliveCore ( ) => AssertIsAlive ( ) ;
43+
4044 /// <inheritdoc />
4145 public int Count
4246 => Sync ! . Reading ( ( ) =>
@@ -51,15 +55,15 @@ protected virtual void AddInternal(T item)
5155
5256 /// <inheritdoc />
5357 public void Add ( T item )
54- => Sync ! . Modifying ( ( ) => AssertIsAlive ( ) , ( ) =>
58+ => Sync ! . Modifying ( AssertIsAliveCore , ( ) =>
5559 {
5660 AddInternal ( item ) ;
5761 return true ;
5862 } ) ;
5963
60- /// <inheritdoc cref="IAddMultiple{T}.AddThese (T, T, T[])" />
61- public void AddThese ( T item1 , T item2 , params T [ ] items )
62- => Sync ! . Modifying ( ( ) => AssertIsAlive ( ) , ( ) =>
64+ /// <inheritdoc cref="IAddMultiple{T}.Add (T, T, T[])" />
65+ public void Add ( T item1 , T item2 , params T [ ] items )
66+ => Sync ! . Modifying ( AssertIsAliveCore , ( ) =>
6367 {
6468 AddInternal ( item1 ) ;
6569 AddInternal ( item2 ) ;
@@ -83,7 +87,7 @@ public void AddRange(IEnumerable<T> items)
8387 if ( enumerable . Count == 0 )
8488 return ;
8589
86- Sync ! . Modifying ( ( ) => AssertIsAlive ( ) , ( ) =>
90+ Sync ! . Modifying ( AssertIsAliveCore , ( ) =>
8791 {
8892 foreach ( var item in enumerable )
8993 AddInternal ( item ) ;
@@ -122,7 +126,7 @@ public void CopyTo(T[] array, int arrayIndex)
122126 /// <inheritdoc />
123127 public virtual bool Remove ( T item )
124128 => Sync ! . Modifying (
125- ( ) => AssertIsAlive ( ) ,
129+ AssertIsAliveCore ,
126130 ( ) => InternalSource . Remove ( item ) ) ;
127131
128132 [ ExcludeFromCodeCoverage ]
0 commit comments