mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: fix if cond break readability (#8132)
This commit is contained in:
@@ -119,7 +119,8 @@ fn (mut ws Client) read_handshake_str() ?string {
|
||||
msg[total_bytes_read] = buffer[0]
|
||||
total_bytes_read++
|
||||
if total_bytes_read > 5 && msg[total_bytes_read - 1] == `\n` && msg[total_bytes_read -
|
||||
2] == `\r` && msg[total_bytes_read - 3] == `\n` && msg[total_bytes_read - 4] == `\r` {
|
||||
2] == `\r` && msg[total_bytes_read - 3] == `\n` && msg[total_bytes_read - 4] == `\r`
|
||||
{
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,8 @@ pub fn (mut ws Client) validate_frame(frame &Frame) ? {
|
||||
return error('rsv cannot be other than 0, not negotiated')
|
||||
}
|
||||
if (int(frame.opcode) >= 3 && int(frame.opcode) <= 7) ||
|
||||
(int(frame.opcode) >= 11 && int(frame.opcode) <= 15) {
|
||||
(int(frame.opcode) >= 11 && int(frame.opcode) <= 15)
|
||||
{
|
||||
ws.close(1002, 'use of reserved opcode') ?
|
||||
return error('use of reserved opcode')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user