File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ export default function rank(values, valueof = ascending) {
88 if ( valueof . length !== 2 ) V = V . map ( valueof ) , valueof = ascending ;
99 const compareIndex = ( i , j ) => valueof ( V [ i ] , V [ j ] ) ;
1010 let k , r ;
11- Uint32Array
12- . from ( V , ( _ , i ) => i )
13- . sort ( valueof === ascending ? ( i , j ) => ascendingDefined ( V [ i ] , V [ j ] ) : compareDefined ( compareIndex ) )
14- . forEach ( ( j , i ) => {
11+ values = Uint32Array . from ( V , ( _ , i ) => i ) ;
12+ // Risky chaining due to Safari 14 https://github.com/d3/d3-array/issues/123
13+ values . sort ( valueof === ascending ? ( i , j ) => ascendingDefined ( V [ i ] , V [ j ] ) : compareDefined ( compareIndex ) ) ;
14+ values . forEach ( ( j , i ) => {
1515 const c = compareIndex ( j , k === undefined ? j : k ) ;
1616 if ( c >= 0 ) {
1717 if ( k === undefined || c > 0 ) k = j , r = i ;
You can’t perform that action at this time.
0 commit comments