mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
status.go: simplify Buffer()
s.health and s.status are always have only one element with a single char length
This commit is contained in:
parent
117c3bc7b5
commit
4fbc998a41
@ -32,16 +32,8 @@ func NewStatus() CompactCol {
|
||||
|
||||
func (s *Status) Buffer() ui.Buffer {
|
||||
buf := s.Block.Buffer()
|
||||
x := 0
|
||||
for _, c := range s.health {
|
||||
buf.Set(s.InnerX()+x, s.InnerY(), c)
|
||||
x += c.Width()
|
||||
}
|
||||
x += 1
|
||||
for _, c := range s.status {
|
||||
buf.Set(s.InnerX()+x, s.InnerY(), c)
|
||||
x += c.Width()
|
||||
}
|
||||
buf.Set(s.InnerX(), s.InnerY(), s.health[0])
|
||||
buf.Set(s.InnerX()+2, s.InnerY(), s.status[0])
|
||||
return buf
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user