v: remove the automatic passing of structs with more than 8 fields by reference (related #17159) (#22547)

This commit is contained in:
yuyi 2024-10-17 16:04:23 +08:00 committed by GitHub
parent 5f413f48f8
commit e97036a25b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 146 additions and 175 deletions

View file

@ -456,14 +456,14 @@ pub fn (mut ws Client) set_state(state State) {
}
// get_state return the current state of the websocket connection
pub fn (ws Client) get_state() State {
pub fn (ws &Client) get_state() State {
return rlock ws.client_state {
ws.client_state.state
}
}
// assert_not_connected returns error if the connection is not connected
fn (ws Client) assert_not_connected() ! {
fn (ws &Client) assert_not_connected() ! {
match ws.get_state() {
.connecting { return error('connect: websocket is connecting') }
.open { return error('connect: websocket already open') }