Skip to content

Commit 63597a9

Browse files
quasilytexiang90
authored andcommitted
remove excessive []byte(s) conversion (etcd-io#143)
`copy` permits using to mix `[]byte` and `string` arguments without explicit conversion. I removed explicit conversion to make the code simpler. Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
1 parent 8693da9 commit 63597a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

node_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ func TestNode_read_LeafPage(t *testing.T) {
4545

4646
// Write data for the nodes at the end.
4747
data := (*[4096]byte)(unsafe.Pointer(&nodes[2]))
48-
copy(data[:], []byte("barfooz"))
49-
copy(data[7:], []byte("helloworldbye"))
48+
copy(data[:], "barfooz")
49+
copy(data[7:], "helloworldbye")
5050

5151
// Deserialize page into a leaf.
5252
n := &node{}

0 commit comments

Comments
 (0)