mirror of
https://github.com/trezor/blockbook.git
synced 2026-02-20 00:51:39 +01:00
refactor: use the built-in max/min to simplify the code
Signed-off-by: evenevent <digping@icloud.com>
This commit is contained in:
@@ -304,7 +304,7 @@ func writeTable(w io.Writer, header []string, slice PortInfoSlice) {
|
||||
padding[column] = len(header[column])
|
||||
|
||||
for _, row := range rows {
|
||||
padding[column] = maxInt(padding[column], len(row[column]))
|
||||
padding[column] = max(padding[column], len(row[column]))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,13 +322,6 @@ func writeTable(w io.Writer, header []string, slice PortInfoSlice) {
|
||||
}
|
||||
}
|
||||
|
||||
func maxInt(a, b int) int {
|
||||
if a > b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func paddedRow(row []string, padding []int) []string {
|
||||
out := make([]string, len(row))
|
||||
for i := 0; i < len(row); i++ {
|
||||
|
||||
Reference in New Issue
Block a user