LibCore: Remove unused TCPServer constructor parameter

This commit is contained in:
Andreas Kling 2025-08-10 16:26:49 +02:00 committed by Andreas Kling
commit 036aa43a41
Notes: github-actions[bot] 2025-08-11 14:58:02 +00:00
3 changed files with 10 additions and 12 deletions

View file

@ -15,7 +15,7 @@
namespace Core {
ErrorOr<NonnullRefPtr<TCPServer>> TCPServer::try_create(EventReceiver* parent)
ErrorOr<NonnullRefPtr<TCPServer>> TCPServer::try_create()
{
int fd = TRY(Core::System::socket(AF_INET, SOCK_STREAM, 0));
ArmedScopeGuard close_fd { [fd]() {
@ -28,12 +28,11 @@ ErrorOr<NonnullRefPtr<TCPServer>> TCPServer::try_create(EventReceiver* parent)
if (SetHandleInformation(to_handle(fd), HANDLE_FLAG_INHERIT, 0) == 0)
return Error::from_windows_error();
close_fd.disarm();
return adopt_nonnull_ref_or_enomem(new (nothrow) TCPServer(fd, parent));
return adopt_nonnull_ref_or_enomem(new (nothrow) TCPServer(fd));
}
TCPServer::TCPServer(int fd, EventReceiver* parent)
: EventReceiver(parent)
, m_fd(fd)
TCPServer::TCPServer(int fd)
: m_fd(fd)
{
VERIFY(m_fd >= 0);
}