File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed
Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ function SortWorker() {
140140
141141 // calculate per-bin base and divider
142142 for ( let i = 0 ; i < numBins ; ++ i ) {
143- binDivider [ i ] = Math . ceil ( binCount [ i ] / binTotal * bucketCount ) ;
143+ binDivider [ i ] = ( binCount [ i ] / binTotal * bucketCount ) >>> 0 ;
144144 }
145145 for ( let i = 0 ; i < numBins ; ++ i ) {
146146 binBase [ i ] = i === 0 ? 0 : binBase [ i - 1 ] + binDivider [ i - 1 ] ;
@@ -157,10 +157,6 @@ function SortWorker() {
157157 const bin = d >>> 0 ;
158158 const sortKey = ( binBase [ bin ] + binDivider [ bin ] * ( d - bin ) ) >>> 0 ;
159159
160- if ( sortKey < 0 || sortKey >= bucketCount ) {
161- console . log ( `i=${ i } d=${ d } bin=${ bin } sortKey=${ sortKey } bucketCount=${ bucketCount } ` ) ;
162- }
163-
164160 distances [ i ] = sortKey ;
165161
166162 // count occurrences of each distance
You can’t perform that action at this time.
0 commit comments