We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5da2f4 commit 3dafabdCopy full SHA for 3dafabd
src/node_options.h
@@ -28,24 +28,23 @@ class HostPort {
28
29
void set_host(const std::string& host) { host_name_ = host; }
30
31
- void set_port(int port) { port_ = port; }
+ void set_port(uint16_t port) { port_ = port; }
32
33
const std::string& host() const { return host_name_; }
34
35
- int port() const {
36
- // TODO(joyeecheung): make port a uint16_t
+ uint16_t port() const {
37
CHECK_GE(port_, 0);
38
return port_;
39
}
40
41
void Update(const HostPort& other) {
42
if (!other.host_name_.empty()) host_name_ = other.host_name_;
43
- if (other.port_ >= 0) port_ = other.port_;
+ port_ = other.port_;
44
45
46
private:
47
std::string host_name_;
48
- int port_;
+ uint16_t port_;
49
};
50
51
class Options {
0 commit comments