ArrayRange and RenderTreeDiff are readonly structs, so use fields directly

This commit is contained in:
Steve Sanderson 2018-02-07 00:49:53 +00:00
parent 83fa72bc7e
commit 48627db47f
2 changed files with 5 additions and 5 deletions

View File

@ -16,12 +16,12 @@ namespace Microsoft.AspNetCore.Blazor.RenderTree
/// <summary>
/// Gets the underlying array instance.
/// </summary>
public T[] Array { get; }
public readonly T[] Array;
/// <summary>
/// Gets the number of items in the array that are considered to be in use.
/// </summary>
public int Count { get; }
public readonly int Count;
/// <summary>
/// Constructs an instance of <see cref="ArrayRange{T}"/>.

View File

@ -11,19 +11,19 @@ namespace Microsoft.AspNetCore.Blazor.RenderTree
/// <summary>
/// Gets the ID of the component.
/// </summary>
public int ComponentId { get; }
public readonly int ComponentId;
/// <summary>
/// Gets the changes to the render tree since a previous state.
/// </summary>
public ArrayRange<RenderTreeEdit> Edits { get; }
public readonly ArrayRange<RenderTreeEdit> Edits;
/// <summary>
/// Gets render frames that may be referenced by entries in <see cref="Edits"/>.
/// For example, edit entries of type <see cref="RenderTreeEditType.PrependFrame"/>
/// will point to an entry in this array to specify the subtree to be prepended.
/// </summary>
public ArrayRange<RenderTreeFrame> ReferenceFrames { get; }
public readonly ArrayRange<RenderTreeFrame> ReferenceFrames;
internal RenderTreeDiff(
int componentId,