Skip to content

Commit 0faf614

Browse files
committed
Change AddSinglePixOrCopy to accept 'in PixOrCopy'
1 parent ff9d3a6 commit 0faf614

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/ImageSharp/Formats/Webp/Lossless/CostModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void Build(int xSize, int cacheBits, Vp8LBackwardRefs backwardRefs)
4242
// The following code is similar to HistogramCreate but converts the distance to plane code.
4343
foreach (PixOrCopy v in backwardRefs)
4444
{
45-
histogram.AddSinglePixOrCopy(v, true, xSize);
45+
histogram.AddSinglePixOrCopy(in v, true, xSize);
4646
}
4747

4848
ConvertPopulationCountTableToBitEstimates(histogram.NumCodes(), histogram.Literal, this.Literal);

src/ImageSharp/Formats/Webp/Lossless/HistogramEncoder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private static void HistogramBuild(
113113
foreach (PixOrCopy v in backwardRefs)
114114
{
115115
int ix = ((y >> histoBits) * histoXSize) + (x >> histoBits);
116-
histograms[ix].AddSinglePixOrCopy(v, false);
116+
histograms[ix].AddSinglePixOrCopy(in v, false);
117117
x += v.Len;
118118
while (x >= xSize)
119119
{

src/ImageSharp/Formats/Webp/Lossless/Vp8LHistogram.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void StoreRefs(Vp8LBackwardRefs refs)
140140
{
141141
foreach (PixOrCopy v in refs)
142142
{
143-
this.AddSinglePixOrCopy(v, false);
143+
this.AddSinglePixOrCopy(in v, false);
144144
}
145145
}
146146

@@ -150,7 +150,7 @@ public void StoreRefs(Vp8LBackwardRefs refs)
150150
/// <param name="v">The token to add.</param>
151151
/// <param name="useDistanceModifier">Indicates whether to use the distance modifier.</param>
152152
/// <param name="xSize">xSize is only used when useDistanceModifier is true.</param>
153-
public void AddSinglePixOrCopy(PixOrCopy v, bool useDistanceModifier, int xSize = 0)
153+
public void AddSinglePixOrCopy(in PixOrCopy v, bool useDistanceModifier, int xSize = 0)
154154
{
155155
if (v.IsLiteral())
156156
{

0 commit comments

Comments
 (0)