Skip to content

Commit 81202c8

Browse files
FrankReholi-obk
authored andcommitted
epoll: remove extraneous clone of ready_list
A simplification that doesn't impact the epoll implementation's logic. It is not necessary to clone the ready_list before reading its `is_empty` state. This avoids the clone step but more importantly avoids the invisible drop step of the clone.
1 parent 86bb137 commit 81202c8

File tree

1 file changed

+1
-2
lines changed
  • src/tools/miri/src/shims/unix/linux

1 file changed

+1
-2
lines changed

src/tools/miri/src/shims/unix/linux/epoll.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
475475
let epoll_file_description = epfd
476476
.downcast::<Epoll>()
477477
.ok_or_else(|| err_unsup_format!("non-epoll FD passed to `epoll_wait`"))?;
478-
let binding = epoll_file_description.get_ready_list();
479-
ready_list_empty = binding.mapping.borrow_mut().is_empty();
478+
ready_list_empty = epoll_file_description.ready_list.mapping.borrow().is_empty();
480479
thread_ids = epoll_file_description.thread_id.borrow_mut();
481480
}
482481
if timeout == 0 || !ready_list_empty {

0 commit comments

Comments
 (0)