From 43b3c8631d69f3d6469a45e7103b1d9152850cb4 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Wed, 19 Sep 2018 16:22:09 +0930 Subject: [PATCH] rtmp: remove unused memset --- rtmp/rtmp.go | 6 ------ rtmp/rtmp_test.go | 16 ---------------- 2 files changed, 22 deletions(-) diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 3b5abe66..31c52cc0 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -1683,12 +1683,6 @@ func memmove(to, from unsafe.Pointer, n uintptr) { } } -func memset(ptr *byte, val byte, num int) { - for i := 0; i < num; i++ { - (*[_Gi]byte)(unsafe.Pointer(ptr))[i] = val - } -} - // Creates a new C style string from a go string func goStrToCStr(str string) *byte { l := len(str) diff --git a/rtmp/rtmp_test.go b/rtmp/rtmp_test.go index 047f4c97..c11b5b39 100644 --- a/rtmp/rtmp_test.go +++ b/rtmp/rtmp_test.go @@ -53,22 +53,6 @@ var ( errMsg = "Obtained: %v, but wanted: %v" ) -func TestMemset(t *testing.T) { - size := 10 - setNum := 5 - testVal := byte('A') - mem := make([]byte, size) - memset(&mem[0], testVal, setNum) - for i := 0; i < size; i++ { - if i > setNum-1 { - testVal = byte(0) - } - if mem[i] != testVal { - t.Errorf("mem doesn't match expected values at: %v", i) - } - } -} - func TestGoStrToCStr(t *testing.T) { goStr := "string\000" bStr := goStrToCStr(goStr)