Skip to content

Commit

Permalink
optimize epoll iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
karlseguin committed Oct 30, 2024
1 parent 8688eee commit 2c282c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/httpz.zig
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ pub fn Server(comptime H: type) type {
try posix.setsockopt(listener, posix.SOL.SOCKET, posix.SO.REUSEPORT_LB, &std.mem.toBytes(@as(c_int, 1)));
} else if (@hasDecl(posix.SO, "REUSEPORT")) {
try posix.setsockopt(listener, posix.SOL.SOCKET, posix.SO.REUSEPORT, &std.mem.toBytes(@as(c_int, 1)));
} else {
}

{
Expand Down
4 changes: 2 additions & 2 deletions src/worker.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1252,8 +1252,8 @@ fn EPoll(comptime WSH: type) type {
return null;
}
self.index = index + 1;
const event = &self.events[index];
switch (event.data.ptr) {

switch (events[index].data.ptr) {
0 => return .{ .accept = {} },
1 => return .{ .signal = {} },
2 => return .{ .shutdown = {} },
Expand Down

0 comments on commit 2c282c9

Please sign in to comment.