diff --git a/Recyclable.Collections/RecyclableCollectionVersion.cs b/Recyclable.Collections/RecyclableCollectionVersion.cs deleted file mode 100644 index 829e1a1..0000000 --- a/Recyclable.Collections/RecyclableCollectionVersion.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace Recyclable.Collections -{ - public delegate void VersionChangedEventHandler(); - - public sealed class RecyclableCollectionVersion - { - //private ulong _enumeratorCount; - - //private ulong _version; - //public ulong Version - //{ - // get => _version; - - // set - // { - // _version = value; - // _versionChanged?.Invoke(this, EventArgs.Empty); - // } - //} - - //public uint Version { get; set; } - - public bool IsVersioned; - - private VersionChangedEventHandler? _versionChanged; - public event VersionChangedEventHandler VersionChanged - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - add - { - _versionChanged += value; - if (!IsVersioned) - { - IsVersioned = true; - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - remove - { - _versionChanged -= value; - if (_versionChanged == null) - { - IsVersioned = false; - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Inc() - { - if (IsVersioned) - { - _versionChanged!(); - } - //_ = unchecked(Version++); - } - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - //public RecyclableCollectionVersion AddEnumerator() - //{ - // if (unchecked(_enumeratorCount++) == 0) - // { - // IsVersioned = true; - // } - - // return this; - //} - - //[MethodImpl(MethodImplOptions.AggressiveInlining)] - //public void RemoveEnumerator() - //{ - // if (unchecked(--_enumeratorCount) == 0) - // { - // IsVersioned = false; - // } - //} - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public RecyclableCollectionVersion Reset() - { - IsVersioned = false; - //Version = 0; - //_enumeratorCount = 0; - return this; - } - } -} diff --git a/Recyclable.Collections/RecyclableList.cs b/Recyclable.Collections/RecyclableList.cs index 785cc2f..9fde854 100644 --- a/Recyclable.Collections/RecyclableList.cs +++ b/Recyclable.Collections/RecyclableList.cs @@ -1,5 +1,4 @@ -using Recyclable.Collections.Pools; -using System.Buffers; +using System.Buffers; using System.Collections; using System.Runtime.CompilerServices;