Table of Contents

Method InvokeWithFilledSpan

Namespace
Alternet.Skia
Assembly
Alternet.UI.Common.dll

InvokeWithFilledSpan(int, char, ReadOnlySpanAction<char>, bool)

Allocates a Span<T> of the specified length, fills it with the given character, and invokes the provided action with the resulting ReadOnlySpan<T>. Uses stack allocation if the span size is below the threshold; otherwise falls back to heap.

public static void InvokeWithFilledSpan(int count, char ch, SkiaHelper.ReadOnlySpanAction<char> action, bool invokeOnEmpty = false)

Parameters

count int

The number of characters to allocate and fill.

ch char

The character to fill the span with.

action SkiaHelper.ReadOnlySpanAction<char>

The callback to invoke with the filled span.

invokeOnEmpty bool

If true, the action will be invoked with an empty span when count is zero or negative. If false, the action will be skipped in that case.