net,vweb: reduce allocations by ~80%

This commit is contained in:
Alexander Medvednikov 2023-11-11 01:10:23 +03:00
parent b3a9701129
commit e7cad4f55d
12 changed files with 464 additions and 91 deletions

View file

@ -59,8 +59,9 @@ pub fn read_set_cookies(h map[string][]string) []&Cookie {
// returns the successfully parsed Cookies.
//
// if `filter` isn't empty, only cookies of that name are returned
pub fn read_cookies(h map[string][]string, filter string) []&Cookie {
lines := h['Cookie']
pub fn read_cookies(h Header, filter string) []&Cookie {
// lines := h['Cookie']
lines := h.values(.cookie) // or {
if lines.len == 0 {
return []
}