Summary: We can safely assume that ports are always going to be 16bit (TCP or UDP), so no need to have a uint32_t here.
Test Plan: Ran tests in folly/tests.
Reviewed By: tudorb@fb.com
FB internal diff:
D973291
StringPiece port(authorityMatch[4].first, authorityMatch[4].second);
if (!port.empty()) {
- port_ = to<uint32_t>(port);
+ port_ = to<uint16_t>(port);
}
username_ = submatch(authorityMatch, 1);
const fbstring& username() const { return username_; }
const fbstring& password() const { return password_; }
const fbstring& host() const { return host_; }
- uint32_t port() const { return port_; }
+ uint16_t port() const { return port_; }
const fbstring& path() const { return path_; }
const fbstring& query() const { return query_; }
const fbstring& fragment() const { return fragment_; }
fbstring username_;
fbstring password_;
fbstring host_;
- uint32_t port_;
+ uint16_t port_;
fbstring path_;
fbstring query_;
fbstring fragment_;