mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-04 21:36:45 +00:00
avoid casting to int when comparing longs
This commit is contained in:
parent
d3881f76b9
commit
3a4d385560
5 changed files with 16 additions and 6 deletions
2
drongo
2
drongo
|
@ -1 +1 @@
|
|||
Subproject commit 401d3b8bfbffb8396a4d76737b4d335389b60051
|
||||
Subproject commit 67c76c3b28158e38dbf6a5a3eb49f4a03b01b7b1
|
|
@ -39,7 +39,7 @@ public class UtxosChart extends BarChart<String, Number> {
|
|||
public void update(WalletUtxosEntry walletUtxosEntry) {
|
||||
List<Data<String, Number>> utxoDataList = walletUtxosEntry.getChildren().stream()
|
||||
.map(entry -> new XYChart.Data<>(getCategoryName(entry), (Number)entry.getValue(), entry))
|
||||
.sorted((o1, o2) -> (int) (o2.getYValue().longValue() - o1.getYValue().longValue()))
|
||||
.sorted((o1, o2) -> Long.compare(o2.getYValue().longValue(), o1.getYValue().longValue()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
totalUtxos = utxoDataList.size();
|
||||
|
|
|
@ -101,6 +101,6 @@ public class HashIndexEntry extends Entry implements Comparable<HashIndexEntry>
|
|||
return o.getHashIndex().getComparisonHeight() - getHashIndex().getComparisonHeight();
|
||||
}
|
||||
|
||||
return (int)o.getHashIndex().getIndex() - (int)getHashIndex().getIndex();
|
||||
return Long.compare(o.getHashIndex().getIndex(), (int)getHashIndex().getIndex());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ public class TransactionEntry extends Entry implements Comparable<TransactionEnt
|
|||
return entry1.getType().ordinal() - entry2.getType().ordinal();
|
||||
}
|
||||
|
||||
return (int) entry1.getHashIndex().getIndex() - (int) entry2.getHashIndex().getIndex();
|
||||
return Long.compare(entry1.getHashIndex().getIndex(), entry2.getHashIndex().getIndex());
|
||||
});
|
||||
|
||||
return childEntries;
|
||||
|
|
10
~/.sparrow-peak/config
Normal file
10
~/.sparrow-peak/config
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"mode": "OFFLINE",
|
||||
"bitcoinUnit": "AUTO",
|
||||
"groupByAddress": true,
|
||||
"includeMempoolChange": true,
|
||||
"notifyNewTransactions": true,
|
||||
"checkNewVersions": true,
|
||||
"theme": "LIGHT",
|
||||
"useProxy": false
|
||||
}
|
Loading…
Reference in a new issue