Skip to content

Commit

Permalink
Fix redundant return statement
Browse files Browse the repository at this point in the history
Fix redundant return statement and unused branch


Once more fixing redundant return


Fix redundant return statement


Fix redundant return statement
  • Loading branch information
hugmouse authored and aarzilli committed Oct 12, 2019
1 parent a6601ab commit e6e00a9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
1 change: 0 additions & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func contextAllCommands(ctx *context) {
}
}
ctx.cmds = append(ctx.cmds, ctx.finalCmds.Commands...)
return
}

func (ctx *context) setupMasterWindow(layout *panel, updatefn UpdateFn) {
Expand Down
19 changes: 2 additions & 17 deletions drawing.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ func (dwh *drawableWindowHeader) Draw(z *nstyle.Style, out *command.Buffer) {
background = &style.Header.Normal
text.Text = style.Header.LabelNormal
}
if dwh.Hovered {
} else {
}

/* draw header background */
if background.Type == nstyle.ItemImage {
Expand All @@ -136,7 +133,6 @@ func (dwh *drawableWindowHeader) Draw(z *nstyle.Style, out *command.Buffer) {
text.Padding = image.Point{0, 0}
widgetText(out, dwh.Label, dwh.Title, &text, "LC", z.Font)
}
return
}

type drawableWindowBody struct {
Expand All @@ -155,7 +151,6 @@ func (dwb *drawableWindowBody) Draw(z *nstyle.Style, out *command.Buffer) {
if !dwb.NoScrollbar {
out.Clip.W += dwb.Style.ScrollbarSize.X
}
return
}

type drawableScalerAndBorders struct {
Expand Down Expand Up @@ -200,7 +195,7 @@ func (d *drawableScalerAndBorders) Draw(z *nstyle.Style, out *command.Buffer) {
/* draw right border */
out.StrokeLine(image.Point{d.Bounds.X + d.Bounds.W - d.Border, d.Bounds.Y + d.Border/2.0}, image.Point{d.Bounds.X + d.Bounds.W - d.Border, d.PaddingY - d.Border}, d.Border, d.BorderColor)
}
return

}

///////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -293,7 +288,7 @@ func drawTextButton(win *Window, bounds rect.Rect, content rect.Rect, state nsty
}

widgetText(out, content, txt, &text, align, font)
return

}

func drawSymbolButton(win *Window, bounds rect.Rect, content rect.Rect, state nstyle.WidgetStates, style *nstyle.Button, symbol label.SymbolType) {
Expand Down Expand Up @@ -328,7 +323,6 @@ func drawSymbolButton(win *Window, bounds rect.Rect, content rect.Rect, state ns
sym = style.TextNormal
}
drawSymbol(out, symbol, content, bg, sym, style.SymbolBorderWidth, font)
return
}

func drawImageButton(win *Window, bounds rect.Rect, content rect.Rect, state nstyle.WidgetStates, style *nstyle.Button, img *image.RGBA) {
Expand All @@ -345,7 +339,6 @@ func drawImageButton(win *Window, bounds rect.Rect, content rect.Rect, state nst
}
drawButton(out, bounds, state, style)
out.DrawImage(content, img)
return
}

func drawTextSymbolButton(win *Window, bounds, labelrect, symbolrect rect.Rect, state nstyle.WidgetStates, style *nstyle.Button, str string, symbol label.SymbolType) {
Expand Down Expand Up @@ -389,7 +382,6 @@ func drawTextSymbolButton(win *Window, bounds, labelrect, symbolrect rect.Rect,
text.Padding = image.Point{0, 0}
drawSymbol(out, symbol, symbolrect, style.TextBackground, sym, 0, font)
widgetText(out, labelrect, str, &text, "CC", font)
return
}

func drawTextImageButton(win *Window, bounds, labelrect, imgrect rect.Rect, state nstyle.WidgetStates, style *nstyle.Button, str string, img *image.RGBA) {
Expand Down Expand Up @@ -427,7 +419,6 @@ func drawTextImageButton(win *Window, bounds, labelrect, imgrect rect.Rect, stat
text.Padding = image.Point{0, 0}
widgetText(out, labelrect, str, &text, "CC", font)
out.DrawImage(imgrect, img)
return
}

///////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -488,7 +479,6 @@ func drawSelectable(win *Window, state nstyle.WidgetStates, style *nstyle.Select
}

widgetText(out, bounds, str, &text, align, font)
return
}

///////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -536,7 +526,6 @@ func drawScrollbar(win *Window, state nstyle.WidgetStates, style *nstyle.Scrollb
} else {
out.FillRect(scroll, style.Rounding, cursorstyle.Data.Color)
}
return
}

///////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -612,7 +601,6 @@ func drawTogglebox(win *Window, type_ toggleType, state nstyle.WidgetStates, sty
text.Padding.Y = 0
text.Background = style.TextBackground
widgetText(out, labelrect, str, &text, "LC", font)
return
}

///////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -661,7 +649,6 @@ func drawProgress(win *Window, state nstyle.WidgetStates, style *nstyle.Progress
} else {
out.FillRect(scursor, style.Rounding, cursor.Data.Color)
}
return
}

///////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -741,7 +728,6 @@ func drawSlider(win *Window, state nstyle.WidgetStates, style *nstyle.Slider, bo
} else {
out.FillCircle(scursor, cursor.Data.Color)
}
return
}

///////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -790,7 +776,6 @@ func drawProperty(win *Window, style *nstyle.Property, bounds, labelrect rect.Re

// draw label
widgetText(out, labelrect, name, &text, "CC", font)
return
}

///////////////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 0 additions & 1 deletion text.go
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,6 @@ func (d *drawableTextEditor) Draw(z *nstyle.Style, out *command.Buffer) {
}

out.PushScissor(old_clip)
return
}

func runeSliceEquals(a, b []rune) bool {
Expand Down

0 comments on commit e6e00a9

Please sign in to comment.