Skip to content

Commit

Permalink
Merge pull request #2103 from turbedi/array_clear
Browse files Browse the repository at this point in the history
Replace Array.Clear(array, 0, array.Length) calls with Array.Clear(array)
  • Loading branch information
brianpopow authored May 2, 2022
2 parents 3e7b2c9 + 0661f14 commit d2bad1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Webp/Lossy/Vp8EncIterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ private void Reset()
this.SetCountDown(this.mbw * this.mbh);
this.InitTop();

Array.Clear(this.BitCount, 0, this.BitCount.Length);
Array.Clear(this.BitCount);
}

/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions src/ImageSharp/Formats/Webp/Lossy/Vp8ModeScore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ public Vp8ModeScore()

public void Clear()
{
Array.Clear(this.YDcLevels, 0, this.YDcLevels.Length);
Array.Clear(this.YAcLevels, 0, this.YAcLevels.Length);
Array.Clear(this.UvLevels, 0, this.UvLevels.Length);
Array.Clear(this.ModesI4, 0, this.ModesI4.Length);
Array.Clear(this.Derr, 0, this.Derr.Length);
Array.Clear(this.YDcLevels);
Array.Clear(this.YAcLevels);
Array.Clear(this.UvLevels);
Array.Clear(this.ModesI4);
Array.Clear(this.Derr);
}

public void InitScore()
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Webp/Lossy/YuvConversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private static void UpSampleScalar(Span<byte> topY, Span<byte> bottomY, Span<byt
private static void UpSampleSse41(Span<byte> topY, Span<byte> bottomY, Span<byte> topU, Span<byte> topV, Span<byte> curU, Span<byte> curV, Span<byte> topDst, Span<byte> bottomDst, int len, byte[] uvBuffer)
{
const int xStep = 3;
Array.Clear(uvBuffer, 0, uvBuffer.Length);
Array.Clear(uvBuffer);
Span<byte> ru = uvBuffer.AsSpan(15);
Span<byte> rv = ru.Slice(32);

Expand Down

0 comments on commit d2bad1f

Please sign in to comment.