mirror of
https://github.com/vlang/v.git
synced 2025-09-16 07:52:32 +03:00
net,vweb: reduce allocations by ~80%
This commit is contained in:
parent
b3a9701129
commit
e7cad4f55d
12 changed files with 464 additions and 91 deletions
|
@ -98,7 +98,12 @@ pub fn (mut r Response) set_status(s Status) {
|
|||
|
||||
// version parses the version
|
||||
pub fn (r Response) version() Version {
|
||||
return version_from_str('HTTP/${r.http_version}')
|
||||
return match r.http_version {
|
||||
'1.0' { .v1_0 }
|
||||
'1.1' { .v1_1 }
|
||||
'2.0' { .v2_0 }
|
||||
else { .unknown }
|
||||
}
|
||||
}
|
||||
|
||||
// set_version sets the http_version string of the response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue