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:
Dandelion Mané 2018-05-10 16:34:48 -07:00
parent 8a4b9592b1
commit 880b0099e9

View File

@ -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}