Add more struct readonlyness hints
This commit is contained in:
parent
1e866f7672
commit
4427b3b773
|
|
@ -92,7 +92,7 @@ namespace Microsoft.AspNetCore.Blazor.Performance
|
|||
{
|
||||
}
|
||||
|
||||
protected override void UpdateDisplay(RenderBatch renderBatch)
|
||||
protected override void UpdateDisplay(in RenderBatch renderBatch)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ namespace Microsoft.AspNetCore.Blazor.Browser.Rendering
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void UpdateDisplay(RenderBatch batch)
|
||||
protected override void UpdateDisplay(in RenderBatch batch)
|
||||
{
|
||||
RegisteredFunction.InvokeUnmarshalled<int, RenderBatch, object>(
|
||||
"renderBatch",
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Blazor.Components
|
|||
/// <summary>
|
||||
/// A bound event handler delegate.
|
||||
/// </summary>
|
||||
public struct EventHandlerInvoker
|
||||
public readonly struct EventHandlerInvoker
|
||||
{
|
||||
private readonly MulticastDelegate _delegate;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Blazor.Components
|
|||
/// <param name="parameterCollection">The <see cref="ParameterCollection"/>.</param>
|
||||
/// <param name="target">An object that has a public writable property matching each parameter's name and type.</param>
|
||||
public static void AssignToProperties(
|
||||
this ParameterCollection parameterCollection,
|
||||
in this ParameterCollection parameterCollection,
|
||||
object target)
|
||||
{
|
||||
if (target == null)
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ namespace Microsoft.AspNetCore.Blazor.RenderTree
|
|||
/// </summary>
|
||||
/// <param name="sequence">An integer that represents the position of the instruction in the source code.</param>
|
||||
/// <param name="frame">A <see cref="RenderTreeFrame"/> holding the name and value of the attribute.</param>
|
||||
public void AddAttribute(int sequence, RenderTreeFrame frame)
|
||||
public void AddAttribute(int sequence, in RenderTreeFrame frame)
|
||||
{
|
||||
if (frame.FrameType != RenderTreeFrameType.Attribute)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ namespace Microsoft.AspNetCore.Blazor.RenderTree
|
|||
}
|
||||
}
|
||||
|
||||
private static int NextSiblingIndex(RenderTreeFrame frame, int frameIndex)
|
||||
private static int NextSiblingIndex(in RenderTreeFrame frame, int frameIndex)
|
||||
{
|
||||
switch (frame.FrameType)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ namespace Microsoft.AspNetCore.Blazor.Rendering
|
|||
/// Updates the visible UI.
|
||||
/// </summary>
|
||||
/// <param name="renderBatch">The changes to the UI since the previous call.</param>
|
||||
protected abstract void UpdateDisplay(RenderBatch renderBatch);
|
||||
protected abstract void UpdateDisplay(in RenderBatch renderBatch);
|
||||
|
||||
/// <summary>
|
||||
/// Notifies the specified component that an event has occurred.
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
public void AttachComponent(IComponent component)
|
||||
=> AssignComponentId(component);
|
||||
|
||||
protected override void UpdateDisplay(RenderBatch renderBatch)
|
||||
protected override void UpdateDisplay(in RenderBatch renderBatch)
|
||||
{
|
||||
LatestBatchReferenceFrames = renderBatch.ReferenceFrames.ToArray();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1005,7 +1005,7 @@ namespace Microsoft.AspNetCore.Blazor.Test
|
|||
{
|
||||
}
|
||||
|
||||
protected override void UpdateDisplay(RenderBatch renderBatch)
|
||||
protected override void UpdateDisplay(in RenderBatch renderBatch)
|
||||
=> throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1496,7 +1496,7 @@ namespace Microsoft.AspNetCore.Blazor.Test
|
|||
{
|
||||
}
|
||||
|
||||
protected override void UpdateDisplay(RenderBatch renderBatch)
|
||||
protected override void UpdateDisplay(in RenderBatch renderBatch)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1080,7 +1080,7 @@ namespace Microsoft.AspNetCore.Blazor.Test
|
|||
public new int AssignComponentId(IComponent component)
|
||||
=> base.AssignComponentId(component);
|
||||
|
||||
protected override void UpdateDisplay(RenderBatch renderBatch)
|
||||
protected override void UpdateDisplay(in RenderBatch renderBatch)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Blazor.Test.Helpers
|
|||
public T InstantiateComponent<T>() where T : IComponent
|
||||
=> (T)InstantiateComponent(typeof(T));
|
||||
|
||||
protected override void UpdateDisplay(RenderBatch renderBatch)
|
||||
protected override void UpdateDisplay(in RenderBatch renderBatch)
|
||||
{
|
||||
OnUpdateDisplay?.Invoke(renderBatch);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue