mirror of
https://github.com/dotnet/skills.git
synced 2026-09-20 09:49:54 +08:00
e23c4247ce
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
14 lines
284 B
C#
14 lines
284 B
C#
public static class ConditionalIncrement
|
|
{
|
|
public static void IncrementAbove(Span<int> data, int threshold)
|
|
{
|
|
for (int i = 0; i < data.Length; i++)
|
|
{
|
|
if (data[i] > threshold)
|
|
{
|
|
data[i]++;
|
|
}
|
|
}
|
|
}
|
|
}
|