mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
picoev: extract common code to a trace_fd/1 function, cleanup
This commit is contained in:
parent
3939737a8d
commit
6e9a66dbf3
4 changed files with 22 additions and 83 deletions
|
@ -83,18 +83,13 @@ fn (mut pv Picoev) poll_once(max_wait_in_sec int) int {
|
|||
if C.FD_ISSET(target.fd, &writefds) != 0 {
|
||||
read_events |= picoev_write
|
||||
}
|
||||
|
||||
if read_events != 0 {
|
||||
$if trace_fd ? {
|
||||
eprintln('do callback ${target.fd}')
|
||||
}
|
||||
|
||||
trace_fd('do callback ${target.fd}')
|
||||
// do callback!
|
||||
unsafe { target.cb(target.fd, read_events, &pv) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue