event/ServerSocket: pass UniqueSocketDescriptor by value
Passing it by value is actually smaller (32 bit) than the rvalue reference (64 bit pointer), and it ensures that the object is consumed after the call returns, no matter how the methods are implemented.
This commit is contained in:
@@ -206,7 +206,7 @@ public:
|
||||
return HasClients();
|
||||
}
|
||||
|
||||
void AddClient(UniqueSocketDescriptor &&fd);
|
||||
void AddClient(UniqueSocketDescriptor fd);
|
||||
|
||||
/**
|
||||
* Removes a client from the httpd_output.clients linked list.
|
||||
@@ -257,7 +257,7 @@ public:
|
||||
private:
|
||||
virtual void RunDeferred() override;
|
||||
|
||||
void OnAccept(UniqueSocketDescriptor &&fd,
|
||||
void OnAccept(UniqueSocketDescriptor fd,
|
||||
SocketAddress address, int uid) override;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user