mirror of
https://github.com/status-im/sourcecred.git
synced 2025-02-25 18:55:21 +00:00
Remove unnecessary reversals in sort routine
We were sorting low-to-high, and then reversing. We can just sort high-to-low. Test plan: No behavior change (confirm by interacting with the Cred Explorer). Paired with @wchargin
This commit is contained in:
parent
8a4b9592b1
commit
880b0099e9
@ -123,9 +123,8 @@ export class PagerankTable extends React.Component<Props, State> {
|
||||
.sort((a, b) => {
|
||||
const x = pagerankResult.get(a.address).probability;
|
||||
const y = pagerankResult.get(b.address).probability;
|
||||
return x - y;
|
||||
})
|
||||
.reverse();
|
||||
return y - x;
|
||||
});
|
||||
return (
|
||||
<table>
|
||||
<thead>
|
||||
@ -202,9 +201,8 @@ class RecursiveTable extends React.Component<RTProps, RTState> {
|
||||
.sort((a, b) => {
|
||||
const x = pagerankResult.get(a.address).probability;
|
||||
const y = pagerankResult.get(b.address).probability;
|
||||
return x - y;
|
||||
return y - x;
|
||||
})
|
||||
.reverse()
|
||||
.map(({address}) => (
|
||||
<RecursiveTable
|
||||
depth={depth + 1}
|
||||
|
Loading…
x
Reference in New Issue
Block a user