[bisq-network/bisq] Secondary sort order in Market Offer Lists (#4168)

cd2357 notifications at github.com
Fri May 1 08:44:14 UTC 2020


@cd2357 commented on this pull request.



> +        if (reversePrimarySortOrder)
+            primary = primary.reversed();
+
+        return primary.thenComparing(Offer::getAmount);

Minor suggestion to ensure orders with higher amounts are displayed first:

```suggestion
        // 1st comparator: sort by price
        // - ascending, if showing orders to sellers
        // - descending, if showing orders to buyers
        if (reversePrimarySortOrder)
            primary = primary.reversed();

        // 2nd comparator: sort by amount, in descending order
        // The goal is to show the more attractive offers at the top
        // Both buyers and sellers would prefer to see higher amounts first (for orders with the same price)
        Comparator<Offer> secondary = Comparator.comparing(Offer::getAmount, Comparator.reverseOrder());

        return primary.thenComparing(secondary);
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4168#pullrequestreview-404072150
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200501/40dddf35/attachment.html>


More information about the bisq-github mailing list