single collection does not added in CloneCollection, #3

This commit is contained in:
neuecc 2021-09-07 19:09:57 +09:00
parent 1f15edcfd1
commit 3ab53b6caa
3 changed files with 14 additions and 6 deletions

View File

@ -1,8 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
</PropertyGroup> <Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\ObservableCollections\ObservableCollections.csproj" />
</ItemGroup>
</Project> </Project>

View File

@ -1,4 +1,5 @@
using System; using ObservableCollections;
using System;
namespace ConsoleApp namespace ConsoleApp
{ {
@ -6,7 +7,8 @@ namespace ConsoleApp
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
Console.WriteLine("Hello World!");
} }
} }
} }

View File

@ -22,6 +22,7 @@ namespace ObservableCollections.Internal
{ {
this.array = ArrayPool<T>.Shared.Rent(1); this.array = ArrayPool<T>.Shared.Rent(1);
this.length = 1; this.length = 1;
this.array[0] = item;
} }
public CloneCollection(IEnumerable<T> source) public CloneCollection(IEnumerable<T> source)