Skip to content

Commit b3078c1

Browse files
Remove SortUtility
1 parent 9258059 commit b3078c1

File tree

5 files changed

+7
-496
lines changed

5 files changed

+7
-496
lines changed

src/ImageSharp.Drawing/Shapes/Rasterization/ActiveEdgeList.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the Six Labors Split License.
33

44
using System.Runtime.CompilerServices;
5-
using SixLabors.ImageSharp.Drawing.Utilities;
65

76
namespace SixLabors.ImageSharp.Drawing.Shapes.Rasterization;
87

@@ -36,7 +35,7 @@ public ActiveEdgeList(Span<int> buffer)
3635
this.Buffer = buffer;
3736
}
3837

39-
private Span<int> ActiveEdges => this.Buffer.Slice(0, this.count);
38+
private readonly Span<int> ActiveEdges => this.Buffer.Slice(0, this.count);
4039

4140
public void EnterEdge(int edgeIdx) => this.Buffer[this.count++] = edgeIdx | EnteringEdgeFlag;
4241

@@ -120,7 +119,8 @@ public Span<float> ScanOddEven(float y, Span<ScanEdge> edges, Span<float> inters
120119
this.count -= offset;
121120

122121
intersections = intersections.Slice(0, intersectionCounter);
123-
SortUtility.Sort(intersections);
122+
intersections.Sort();
123+
124124
return intersections;
125125
}
126126

@@ -180,7 +180,7 @@ public Span<float> ScanNonZero(
180180

181181
intersections = intersections.Slice(0, intersectionCounter);
182182
intersectionTypes = intersectionTypes.Slice(0, intersectionCounter);
183-
SortUtility.Sort(intersections, intersectionTypes);
183+
intersections.Sort(intersectionTypes);
184184

185185
return ApplyNonzeroRule(intersections, intersectionTypes);
186186
}

src/ImageSharp.Drawing/Shapes/Rasterization/PolygonScanner.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System.Buffers;
55
using System.Runtime.InteropServices;
6-
using SixLabors.ImageSharp.Drawing.Utilities;
76
using SixLabors.ImageSharp.Memory;
87

98
namespace SixLabors.ImageSharp.Drawing.Shapes.Rasterization;
@@ -120,8 +119,8 @@ private void Init()
120119
this.sorted1[i] = i;
121120
}
122121

123-
SortUtility.Sort(keys0, this.sorted0);
124-
SortUtility.Sort(keys1, this.sorted1);
122+
keys0.Sort(this.sorted0);
123+
keys1.Sort(this.sorted1);
125124

126125
this.SkipEdgesBeforeMinY();
127126
}
@@ -195,7 +194,7 @@ public ReadOnlySpan<float> ScanCurrentLine()
195194
? this.activeEdges.ScanOddEven(this.SubPixelY, this.edges, this.intersections)
196195
: this.activeEdges.ScanNonZero(this.SubPixelY, this.edges, this.intersections, this.intersectionTypes);
197196

198-
public void Dispose()
197+
public readonly void Dispose()
199198
{
200199
this.edgeCollection.Dispose();
201200
this.dataBuffer.Dispose();

src/ImageSharp.Drawing/Utilities/SortUtility.KeyValueSort.cs

Lines changed: 0 additions & 206 deletions
This file was deleted.

0 commit comments

Comments
 (0)