Skip to content

Commit 8f17e26

Browse files
committed
refactor(runtime/udp): better null safety
1 parent a631558 commit 8f17e26

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/runtime/udp.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ namespace ssc::runtime::udp {
104104
struct sockaddr_in addr;
105105

106106
// callbacks
107-
UDPReceiveCallback receiveCallback;
107+
UDPReceiveCallback receiveCallback = nullptr;
108108
Vector<Function<void()>> onclose;
109109

110110
// instance state

src/runtime/udp/manager.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace ssc::runtime::udp {
3131

3232
bool SocketManager::has (ID id) {
3333
Lock lock(this->mutex);
34-
return this->sockets.find(id) != this->sockets.end();
34+
return this->sockets.contains(id);
3535
}
3636

3737
void SocketManager::remove (ID id) {

0 commit comments

Comments
 (0)