widget: optimize processGlyph

processGlyph does not modify the value, so there's no reason to
return the struct.

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
Egon Elbre
2023-10-23 22:04:52 +03:00
committed by Chris Waldon
parent df8a8789a3
commit 48bd5952b1
3 changed files with 13 additions and 11 deletions
+1 -4
View File
@@ -146,10 +146,7 @@ func TestGlyphIterator(t *testing.T) {
glyphs := getGlyphs(16, 0, maxWidth, text.Start, tc.str)
it := textIterator{viewport: tc.viewport, maxLines: tc.maxLines}
for i, g := range glyphs {
gOut, ok := it.processGlyph(g, true)
if gOut != g {
t.Errorf("textIterator modified glyphs[%d], original:\n%#+v, modified:\n%#+v", i, g, gOut)
}
ok := it.processGlyph(g, true)
if !ok && i != tc.stopAtGlyph {
t.Errorf("expected iterator to stop at glyph %d, stopped at %d", tc.stopAtGlyph, i)
}