File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -28,24 +28,23 @@ class HostPort {
28
28
29
29
void set_host (const std::string& host) { host_name_ = host; }
30
30
31
- void set_port (int port) { port_ = port; }
31
+ void set_port (uint16_t port) { port_ = port; }
32
32
33
33
const std::string& host () const { return host_name_; }
34
34
35
- int port () const {
36
- // TODO(joyeecheung): make port a uint16_t
35
+ uint16_t port () const {
37
36
CHECK_GE (port_, 0 );
38
37
return port_;
39
38
}
40
39
41
40
void Update (const HostPort& other) {
42
41
if (!other.host_name_ .empty ()) host_name_ = other.host_name_ ;
43
- if (other. port_ >= 0 ) port_ = other.port_ ;
42
+ port_ = other.port_ ;
44
43
}
45
44
46
45
private:
47
46
std::string host_name_;
48
- int port_;
47
+ uint16_t port_;
49
48
};
50
49
51
50
class Options {
You can’t perform that action at this time.
0 commit comments