aboutsummaryrefslogtreecommitdiff
path: root/unsafe.go
blob: 1c00c7b16cdea026fb2fd90d7ab2e8dc5b214557 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11

package irc

import "unsafe"

func bytesToString(bytes []byte) (s string) {
	return unsafe.String(unsafe.SliceData(bytes), len(bytes))
}

func stringToBytes(s string) (bytes []byte) {
	return unsafe.Slice(unsafe.StringData(s), len(s))
}