forked from joejulian/gio
all: apply suggestions from staticcheck.io
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -100,7 +100,6 @@ func computeGlyphClusters(l *text.Layout) {
|
||||
clusters = append(clusters, newlineCluster)
|
||||
}
|
||||
l.Clusters = clusters
|
||||
return
|
||||
}
|
||||
|
||||
// langConfig describes the language and writing system of a body of text.
|
||||
@@ -396,10 +395,6 @@ func toGioGlyphs(in []shaping.Glyph) []text.Glyph {
|
||||
|
||||
// ToLine converts the output into a text.Line
|
||||
func (o output) ToLine() text.Line {
|
||||
advances := make([]fixed.Int26_6, 0, len(o.Shaped.Glyphs))
|
||||
for _, glyph := range o.Shaped.Glyphs {
|
||||
advances = append(advances, glyph.XAdvance)
|
||||
}
|
||||
layout := text.Layout{
|
||||
Glyphs: toGioGlyphs(o.Shaped.Glyphs),
|
||||
Runes: o.RuneRange,
|
||||
@@ -458,11 +453,7 @@ func Document(shaper Shaper, face font.Face, ppem fixed.Int26_6, maxWidth int, l
|
||||
}
|
||||
paragraphText = append(paragraphText, r)
|
||||
script := language.LookupScript(r)
|
||||
if _, ok := langs[script]; ok {
|
||||
langs[script]++
|
||||
} else {
|
||||
langs[script] = 1
|
||||
}
|
||||
langs[script]++
|
||||
bytes += sz
|
||||
runes++
|
||||
if r == '\n' {
|
||||
|
||||
@@ -890,7 +890,6 @@ func TestEngineLineWrap(t *testing.T) {
|
||||
func TestEngineDocument(t *testing.T) {
|
||||
const doc = `Rutrum quisque non tellus orci ac auctor augue.
|
||||
At risus viverra adipiscing at.`
|
||||
const numLines = 2
|
||||
english := system.Locale{
|
||||
Language: "EN",
|
||||
Direction: system.LTR,
|
||||
@@ -980,7 +979,6 @@ func TestLayoutComputeClusters(t *testing.T) {
|
||||
type testcase struct {
|
||||
name string
|
||||
line text.Layout
|
||||
lastLine bool
|
||||
expected []text.GlyphCluster
|
||||
}
|
||||
for _, tc := range []testcase{
|
||||
|
||||
Reference in New Issue
Block a user