*: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to consider these functions throwing.
This commit is contained in:
@@ -103,16 +103,16 @@ public:
|
||||
using SocketMonitor::Close;
|
||||
|
||||
gcc_pure
|
||||
std::string ToString() const {
|
||||
std::string ToString() const noexcept {
|
||||
return ::ToString(address);
|
||||
}
|
||||
|
||||
void SetFD(int _fd) {
|
||||
void SetFD(int _fd) noexcept {
|
||||
SocketMonitor::Open(_fd);
|
||||
SocketMonitor::ScheduleRead();
|
||||
}
|
||||
|
||||
void Accept();
|
||||
void Accept() noexcept;
|
||||
|
||||
private:
|
||||
virtual bool OnSocketReady(unsigned flags) override;
|
||||
@@ -146,7 +146,7 @@ get_remote_uid(int fd)
|
||||
}
|
||||
|
||||
inline void
|
||||
OneServerSocket::Accept()
|
||||
OneServerSocket::Accept() noexcept
|
||||
{
|
||||
StaticSocketAddress peer_address;
|
||||
size_t peer_address_length = sizeof(peer_address);
|
||||
@@ -343,7 +343,7 @@ ServerSocket::AddPortIPv6(unsigned port)
|
||||
*/
|
||||
gcc_pure
|
||||
static bool
|
||||
SupportsIPv6()
|
||||
SupportsIPv6() noexcept
|
||||
{
|
||||
int fd = socket(AF_INET6, SOCK_STREAM, 0);
|
||||
if (fd < 0)
|
||||
|
Reference in New Issue
Block a user