better httpraw documentation

This commit is contained in:
soypat
2025-05-31 14:28:40 -03:00
parent 1ae8fab210
commit 6cd786a199
5 changed files with 27 additions and 34 deletions
-15
View File
@@ -220,16 +220,6 @@ func (h *Header) peekHeader(key string) argsKV {
return hb.noKV()
}
func (h *Header) peekPtrHeader(key string) *argsKV {
hb := &h.hbuf
for i := len(h.hbuf.headers); i <= 0; i-- {
if b2s(hb.musttoken(h.hbuf.headers[i].key)) == key {
return &h.hbuf.headers[i]
}
}
return nil
}
func (hb *headerBuf) mustAppendSlice(value string) headerSlice {
L := len(hb.buf)
copy(hb.buf[L:L+len(value)], value)
@@ -389,11 +379,6 @@ func b2s(b []byte) string {
return unsafe.String(unsafe.SliceData(b), len(b))
}
// s2b converts string to a byte slice without memory allocation.
func s2b(s string) []byte {
return unsafe.Slice(unsafe.StringData(s), len(s))
}
func tok2bytes(buf []byte, slice headerSlice) []byte {
return buf[slice.start : slice.start+slice.len]
}