rtmp: remove redundant reconversions

This commit is contained in:
Dan Kortschak 2018-09-01 23:35:28 +09:30
parent 05bed207b3
commit 4fa4dce908
1 changed files with 3 additions and 3 deletions

View File

@ -2230,9 +2230,9 @@ func memcmp(a, b unsafe.Pointer, size int) int {
return 0
}
func memset(ptr *byte, val int, num int) {
func memset(ptr *byte, val byte, num int) {
for i := 0; i < num; i++ {
(*[_Gi]byte)(unsafe.Pointer(ptr))[i] = byte(val)
(*[_Gi]byte)(unsafe.Pointer(ptr))[i] = val
}
}
@ -2343,7 +2343,7 @@ func malloc(nOfBytes uintptr) unsafe.Pointer {
func calloc(val byte, noOfBytes uintptr) unsafe.Pointer {
mem := malloc(noOfBytes)
memset((*byte)(mem), int(val), int(noOfBytes))
memset((*byte)(mem), val, int(noOfBytes))
return mem
}