From: Stephane Sezer Date: Thu, 19 Sep 2013 19:19:26 +0000 (-0700) Subject: Make folly::Uri::port() return uint16_t instead of uint32_t. X-Git-Tag: v0.22.0~874 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4c787a9d2f0ce748d7082fd1a6469f7ed6999dc6;p=folly.git Make folly::Uri::port() return uint16_t instead of uint32_t. 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 --- diff --git a/folly/Uri.cpp b/folly/Uri.cpp index 9ae5c713..a94c9308 100644 --- a/folly/Uri.cpp +++ b/folly/Uri.cpp @@ -79,7 +79,7 @@ Uri::Uri(StringPiece str) : port_(0) { StringPiece port(authorityMatch[4].first, authorityMatch[4].second); if (!port.empty()) { - port_ = to(port); + port_ = to(port); } username_ = submatch(authorityMatch, 1); diff --git a/folly/Uri.h b/folly/Uri.h index 8885bb9f..5ed0a1b7 100644 --- a/folly/Uri.h +++ b/folly/Uri.h @@ -48,7 +48,7 @@ class Uri { 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_; } @@ -64,7 +64,7 @@ class Uri { fbstring username_; fbstring password_; fbstring host_; - uint32_t port_; + uint16_t port_; fbstring path_; fbstring query_; fbstring fragment_;