picoev: remove fmt off tags (#20569)

This commit is contained in:
Hitalo Souza 2024-02-26 03:03:03 -04:00 committed by GitHub
parent 43e96ce5bb
commit 43fd568874
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 34 additions and 28 deletions

View file

@ -51,13 +51,15 @@ pub fn create_kqueue_loop(id int) !&KqueueLoop {
// ev_set sets a new `kevent` with file descriptor `index`
@[inline]
pub fn (mut pv Picoev) ev_set(index int, operation int, events int) {
// vfmt off
filter := i16(
(if events & picoev_read != 0 { C.EVFILT_READ } else { 0 })
|
(if events & picoev_write != 0 { C.EVFILT_WRITE } else { 0 })
)
// vfmt on
mut filter := 0
if events & picoev_read != 0 {
filter |= C.EVFILT_READ
}
if events & picoev_write != 0 {
filter |= C.EVFILT_WRITE
}
filter = i16(filter)
C.EV_SET(&pv.loop.changelist[index], pv.loop.changed_fds, filter, operation, 0, 0,
0)
}