Cysharp / ObservableCollections

High performance observable collections and synchronized views, for WPF, Blazor, Unity.
MIT License
461 stars 36 forks source link

Miss set the item to the array #3

Closed lindexi closed 2 years ago

lindexi commented 2 years ago
        public CloneCollection(T item)
        {
            this.array = ArrayPool<T>.Shared.Rent(1); // And I do not think rent the array which the lenght is one form pool is a good way.
            this.length = 1;
           // Miss:  this.array[0] = item;
        }

Did you forget to assign a value to the variable?

Thank you,

neuecc commented 2 years ago

Oh, that's right! I'll fix soon. Thanks!

lindexi commented 2 years ago

Thank you