From 3fa9ee49a077a0bcb7419110da02ca54a019f2cc Mon Sep 17 00:00:00 2001
From: Alexander Melentyev <alexander@melentyev.org>
Date: Sun, 31 Oct 2021 17:50:22 +0000
Subject: [PATCH] bytes: remove redundant type conversion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Change-Id: Icafb2d9fd11b23d3acaf9df07e7f90d8bcd829fa
GitHub-Last-Rev: 2b766460554860510f3fec03a4b9fe2e65fad268
GitHub-Pull-Request: golang/go#49243
Reviewed-on: https://go-review.googlesource.com/c/go/+/360096
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Trust: Martin Möhrmann <martin@golang.org>
---
 src/bytes/bytes.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bytes/bytes.go b/src/bytes/bytes.go
index 926f65cc8f8..529d95a8884 100644
--- a/src/bytes/bytes.go
+++ b/src/bytes/bytes.go
@@ -699,7 +699,7 @@ func ToValidUTF8(s, replacement []byte) []byte {
 		if c < utf8.RuneSelf {
 			i++
 			invalid = false
-			b = append(b, byte(c))
+			b = append(b, c)
 			continue
 		}
 		_, wid := utf8.DecodeRune(s[i:])
-- 
GitLab