mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
dev: hlint: Avoid use of reverse.
Note that this is semantically different, and will produce different results. In particular, the sort is now stable, i.e. account names with the same balance will not have their order reversed relative to each other. In this context there doesn't seem to be a reason to prefer one order to the other, so I'm making this change.
This commit is contained in:
parent
d248aec313
commit
b7bf780c52
@ -10,7 +10,6 @@
|
||||
- ignore: {name: "Move brackets to avoid $"}
|
||||
- ignore: {name: "Redundant $"}
|
||||
- ignore: {name: "Redundant bracket"}
|
||||
- ignore: {name: "Avoid reverse"}
|
||||
- ignore: {name: "Use sortOn"}
|
||||
- ignore: {name: "Use camelCase"}
|
||||
- ignore: {name: "Use list comprehension"}
|
||||
|
@ -147,7 +147,7 @@ genPie opts (items, _total) = def { _pie_background = solidFillStyle $ opaque $
|
||||
(samesignitems, sign) = sameSignNonZero items
|
||||
top n t = topn ++ [other]
|
||||
where
|
||||
(topn,rest) = splitAt n $ reverse $ sortBy (comparing snd) t
|
||||
(topn,rest) = splitAt n $ sortBy (flip $ comparing snd) t
|
||||
other = ("other", sum $ map snd rest)
|
||||
num = chart_items_ opts
|
||||
hue = if sign > 0 then red else green where (red, green) = (0, 110)
|
||||
|
Loading…
Reference in New Issue
Block a user