浏览代码

bgClr is always zero, no need to set

wangbei 7 年之前
父节点
当前提交
4444a7dc51
共有 1 个文件被更改,包括 0 次插入5 次删除
  1. 0 5
      qrcode.go

+ 0 - 5
qrcode.go

@@ -293,13 +293,8 @@ func (q *QRCode) Image(size int) image.Image {
 	// Saves a few bytes to have them in this order
 	p := color.Palette([]color.Color{q.BackgroundColor, q.ForegroundColor})
 	img := image.NewPaletted(rect, p)
-	bgClr := uint8(img.Palette.Index(q.BackgroundColor))
 	fgClr := uint8(img.Palette.Index(q.ForegroundColor))
 
-	for i := range img.Pix {
-		img.Pix[i] = bgClr
-	}
-
 	bitmap := q.symbol.bitmap()
 	for y, row := range bitmap {
 		for x, v := range row {