Skip to content

Commit 50ec18f

Browse files
committed
already sorted by cliTransactions function
1 parent 563f491 commit 50ec18f

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

ledger/cmd/print.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,6 @@ func WriteTransaction(w io.StringWriter, trans *ledger.Transaction, columns int)
206206

207207
// PrintLedger prints all transactions as a formatted ledger file.
208208
func PrintLedger(generalLedger []*ledger.Transaction, filterArr []string, columns int) {
209-
// Print transactions by date
210-
if len(generalLedger) > 1 {
211-
slices.SortStableFunc(generalLedger, func(a, b *ledger.Transaction) int {
212-
return a.Date.Compare(b.Date)
213-
})
214-
}
215-
216209
buf := bufio.NewWriter(os.Stdout)
217210
for _, trans := range generalLedger {
218211
inFilter := len(filterArr) == 0

ledger/cmd/stats.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55
"log"
66
"math"
7-
"slices"
87
"strings"
98
"time"
109

@@ -31,9 +30,6 @@ func printStats(generalLedger []*ledger.Transaction) {
3130
fmt.Println("Empty ledger.")
3231
return
3332
}
34-
slices.SortFunc(generalLedger, func(a, b *ledger.Transaction) int {
35-
return a.Date.Compare(b.Date)
36-
})
3733

3834
startDate := generalLedger[0].Date
3935
endDate := generalLedger[len(generalLedger)-1].Date

0 commit comments

Comments
 (0)