From 6a0013c62f24654529fd589a7de486bf1888a63b Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 7 Oct 2025 21:35:52 +0200 Subject: minor code improvements (staticcheck) --- go/ui/buffer.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'go/ui/buffer.go') diff --git a/go/ui/buffer.go b/go/ui/buffer.go index c44bbdd0..50044163 100644 --- a/go/ui/buffer.go +++ b/go/ui/buffer.go @@ -47,7 +47,7 @@ func NewBuffer(x, y int, width, height int) *Buffer { func (b *Buffer) render() *ebiten.Image { img := ebiten.NewImage(b.Width, b.Height) img.Fill(b.bg) - var y float64 = -b.font.Size + y := -b.font.Size for i, line := range b.lines[b.pos:] { _, h := text.Measure(line, b.font, b.font.Size*b.lineSpacing) y += h @@ -177,9 +177,7 @@ func (b *StackBuffer) RemoveLast() { // Remove potential highlight i := len(b.actions) - 1 - if _, found := b.highlights[i]; found { - delete(b.highlights, i) - } + delete(b.highlights, i) b.actions = b.actions[:i] } -- cgit v1.2.3