1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fmt: better ternary concat wrapping (#8379)

This commit is contained in:
Lukas Neubert
2021-01-28 11:23:48 +01:00
committed by GitHub
parent d86cb67eda
commit 75d85403a6
12 changed files with 48 additions and 24 deletions

View File

@@ -232,11 +232,8 @@ pub fn (mut ws Client) write_ptr(bytes byteptr, payload_len int, code OPCode) ?
// todo: send error here later
return error('trying to write on a closed socket!')
}
mut header_len := 2 + if payload_len > 125 { 2 } else { 0 } + if payload_len > 0xffff {
6
} else {
0
}
mut header_len := 2 + if payload_len > 125 { 2 } else { 0 } +
if payload_len > 0xffff { 6 } else { 0 }
if !ws.is_server {
header_len += 4
}