Skip to content
Permalink
Browse files

Merged changes from master

  • Loading branch information...
Turnerj committed May 11, 2019
2 parents 0fb6e3e + 27a84c9 commit bc42be86e6fc9b7eaeee13aebe2462b1e4bdc01a

This file was deleted.

@@ -1,4 +1,6 @@
namespace MongoFramework
using System.Collections.Generic;

namespace MongoFramework
{
public class EntityBucket<TGroup, TSubEntity> where TGroup : class
{
@@ -7,6 +9,6 @@ public class EntityBucket<TGroup, TSubEntity> where TGroup : class
public int Index { get; set; }
public int ItemCount { get; set; }
public int BucketSize { get; set; }
public TSubEntity[] Items { get; set; }
public List<TSubEntity> Items { get; set; }
}
}
@@ -55,11 +55,7 @@ public void AddEntity(TGroup group, TSubEntity entity)
var sliceSize = Math.Min(bucket.BucketSize - bucket.ItemCount, remainingEntitiesCount);
var sliceEntities = entityList.Take(sliceSize).ToArray();

for (int i = 0, l = sliceEntities.Length; i < l; i++)
{
bucket.Items[bucket.ItemCount + i] = sliceEntities[i];
}

bucket.Items.AddRange(sliceEntities);
bucket.ItemCount += sliceSize;

entityCollection.Update(bucket, EntityEntryState.Updated);
@@ -74,17 +70,7 @@ public void AddEntity(TGroup group, TSubEntity entity)
while (remainingEntitiesCount > 0)
{
var sliceSize = Math.Min(BucketSize, remainingEntitiesCount);
var sliceEntities = entityList.Skip(sliceAt).Take(sliceSize).ToArray();

var remainingSpace = BucketSize - sliceSize;
if (remainingSpace > 0)
{
Array.Resize(ref sliceEntities, BucketSize);
for (int i = sliceSize, l = BucketSize; i < l; i++)
{
sliceEntities[i] = Activator.CreateInstance<TSubEntity>();
}
}
var sliceEntities = entityList.Skip(sliceAt).Take(sliceSize).ToList();

entityCollection.Add(new EntityBucket<TGroup, TSubEntity>
{

This file was deleted.

0 comments on commit bc42be8

Please sign in to comment.
You can’t perform that action at this time.