@@ -100,6 +100,8 @@ protected override void OnFrameApply(ImageFrame<TPixel> source, Rectangle source
100100 using ( BasicArrayBuffer < float > scanline = source . MemoryManager . AllocateFake < float > ( scanlineWidth ) )
101101 {
102102 bool scanlineDirty = true ;
103+ float subpixelFraction = 1f / subpixelCount ;
104+ float subpixelFractionPoint = subpixelFraction / subpixelCount ;
103105 for ( int y = minY ; y < maxY ; y ++ )
104106 {
105107 if ( scanlineDirty )
@@ -113,9 +115,8 @@ protected override void OnFrameApply(ImageFrame<TPixel> source, Rectangle source
113115 scanlineDirty = false ;
114116 }
115117
116- float subpixelFraction = 1f / subpixelCount ;
117- float subpixelFractionPoint = subpixelFraction / subpixelCount ;
118- for ( float subPixel = ( float ) y ; subPixel < y + 1 ; subPixel += subpixelFraction )
118+ float yPlusOne = y + 1 ;
119+ for ( float subPixel = ( float ) y ; subPixel < yPlusOne ; subPixel += subpixelFraction )
119120 {
120121 int pointsFound = region . Scan ( subPixel + offset , buffer . Array , 0 ) ;
121122 if ( pointsFound == 0 )
@@ -197,8 +198,7 @@ private static void Swap(Span<float> data, int left, int right)
197198
198199 private static void QuickSort ( Span < float > data )
199200 {
200- int hi = Math . Min ( data . Length - 1 , data . Length - 1 ) ;
201- QuickSort ( data , 0 , hi ) ;
201+ QuickSort ( data , 0 , data . Length - 1 ) ;
202202 }
203203
204204 private static void QuickSort ( Span < float > data , int lo , int hi )
0 commit comments