minor refactor but i think no problem
cicd / ci (push) Successful in 1m28s
Details
cicd / ci (push) Successful in 1m28s
Details
parent
1805a087e0
commit
0b4d78796e
|
|
@ -171,21 +171,26 @@ func FPrintBalances(w io.Writer, linePrefix string, balances, cumulatives ledger
|
||||||
}
|
}
|
||||||
for i, key := range keys {
|
for i, key := range keys {
|
||||||
printableKey := key
|
printableKey := key
|
||||||
if !fullKey && i > 0 {
|
if fullKey {
|
||||||
j := 0
|
} else if i == 0 {
|
||||||
n := len(keys[i])
|
} else {
|
||||||
if n2 := len(keys[i-1]); n2 < n {
|
commonPrefixLen := func() int {
|
||||||
n = n2
|
j := 0
|
||||||
}
|
n := len(keys[i])
|
||||||
for j = 0; j < n; j++ {
|
if n2 := len(keys[i-1]); n2 < n {
|
||||||
if keys[i-1][j] != keys[i][j] {
|
n = n2
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
for j = 0; j < n; j++ {
|
||||||
for keys[i][j] != ':' && j > 0 {
|
if keys[i-1][j] != keys[i][j] {
|
||||||
j -= 1
|
break
|
||||||
}
|
}
|
||||||
printableKey = strings.Repeat(" ", j) + keys[i][j:]
|
}
|
||||||
|
for keys[i][j] != ':' && j > 0 {
|
||||||
|
j -= 1
|
||||||
|
}
|
||||||
|
return j
|
||||||
|
}()
|
||||||
|
printableKey = strings.Repeat(" ", commonPrefixLen) + keys[i][commonPrefixLen:]
|
||||||
}
|
}
|
||||||
|
|
||||||
currencies := []ledger.Currency{}
|
currencies := []ledger.Currency{}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue