MCPcopy Index your code
hub / github.com/RustPython/RustPython / insert_fd

Function insert_fd

crates/stdlib/src/select.rs:401–413  ·  view source on GitHub ↗
(fds: &mut Vec<pollfd>, fd: i32, events: i16)

Source from the content-addressed store, hash-verified

399 }
400
401 fn insert_fd(fds: &mut Vec<pollfd>, fd: i32, events: i16) {
402 match search(fds, fd) {
403 Ok(i) => fds[i].events = events,
404 Err(i) => fds.insert(
405 i,
406 pollfd {
407 fd,
408 events,
409 revents: 0,
410 },
411 ),
412 }
413 }
414
415 fn get_fd_mut(fds: &mut [pollfd], fd: i32) -> Option<&mut pollfd> {
416 search(fds, fd).ok().map(move |i| &mut fds[i])

Callers 1

registerMethod · 0.85

Calls 2

searchFunction · 0.70
insertMethod · 0.45

Tested by

no test coverage detected