Skip to content

Commit

Permalink
Release 0.9.11
Browse files Browse the repository at this point in the history
  • Loading branch information
firenero committed Oct 12, 2021
1 parent 08077bd commit ec33d7e
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

namespace EfficientDynamoDb.Internal.Converters.Json
{
internal abstract class JsonCollectionDdbConverter<TCollection, TInitialCollection, TElement> : DdbResumableConverter<TCollection> where TInitialCollection : new()
internal abstract class JsonCollectionDdbConverter<TCollection, TInitialCollection, TElement> : DdbResumableConverter<TCollection>
where TInitialCollection : new()
{
private static readonly Type ElementTypeValue = typeof(TElement);

protected new readonly DdbConverter<TElement> ElementConverter;

internal override DdbClassType ClassType => DdbClassType.Enumerable;
Expand All @@ -27,8 +28,6 @@ protected JsonCollectionDdbConverter(DdbConverter<TElement> elementConverter)
protected abstract void Add(TInitialCollection collection, TElement item, int index);

protected abstract TCollection ToResult(TInitialCollection collection);



internal override bool TryRead(ref DdbReader reader, out TCollection value)
{
Expand All @@ -37,7 +36,7 @@ internal override bool TryRead(ref DdbReader reader, out TCollection value)
value = default!;
return true;
}

var success = false;
reader.State.Push();

Expand Down Expand Up @@ -81,14 +80,14 @@ internal override bool TryRead(ref DdbReader reader, out TCollection value)
TInitialCollection collection;
Unsafe.SkipInit(out value);

if (current.ObjectState < DdbStackFrameObjectState.CreatedObject)
{
current.ReturnValue = collection = new TInitialCollection();
current.ObjectState = DdbStackFrameObjectState.CreatedObject;
if (current.ObjectState < DdbStackFrameObjectState.CreatedObject)
{
current.ReturnValue = collection = new TInitialCollection();
current.ObjectState = DdbStackFrameObjectState.CreatedObject;
}
else
{
collection = (TInitialCollection) current.ReturnValue!;
collection = (TInitialCollection)current.ReturnValue!;
}

if (ElementConverter.UseDirectRead)
Expand Down

0 comments on commit ec33d7e

Please sign in to comment.