Commit f9956e1c authored by Rosen Penev's avatar Rosen Penev Committed by Facebook Github Bot

Remove redundant const (#1297)

Summary:
Found with readability-const-return-typ
Signed-off-by: default avatarRosen Penev <rosenp@gmail.com>
Pull Request resolved: https://github.com/facebook/folly/pull/1297

Reviewed By: Orvid

Differential Revision: D19258433

Pulled By: yfeldblum

fbshipit-source-id: f544c9168887c2ecb27d59ab799cda05c9a49a98
parent d635a49e
...@@ -279,7 +279,7 @@ uint8_t IPAddressV4::getNthMSByte(size_t byteIndex) const { ...@@ -279,7 +279,7 @@ uint8_t IPAddressV4::getNthMSByte(size_t byteIndex) const {
return bytes()[byteIndex]; return bytes()[byteIndex];
} }
// protected // protected
const ByteArray4 IPAddressV4::fetchMask(size_t numBits) { ByteArray4 IPAddressV4::fetchMask(size_t numBits) {
static const size_t bits = bitCount(); static const size_t bits = bitCount();
if (numBits > bits) { if (numBits > bits) {
throw IPAddressFormatException("IPv4 addresses are 32 bits"); throw IPAddressFormatException("IPv4 addresses are 32 bits");
......
...@@ -251,7 +251,7 @@ class IPAddressV4 { ...@@ -251,7 +251,7 @@ class IPAddressV4 {
* @throws abort if numBits == 0 or numBits > bitCount() * @throws abort if numBits == 0 or numBits > bitCount()
* @return mask associated with numBits * @return mask associated with numBits
*/ */
static const ByteArray4 fetchMask(size_t numBits); static ByteArray4 fetchMask(size_t numBits);
// Given 2 IPAddressV4, mask pairs extract the longest common IPAddress, // Given 2 IPAddressV4, mask pairs extract the longest common IPAddress,
// mask pair // mask pair
......
...@@ -498,7 +498,7 @@ uint8_t IPAddressV6::getNthMSByte(size_t byteIndex) const { ...@@ -498,7 +498,7 @@ uint8_t IPAddressV6::getNthMSByte(size_t byteIndex) const {
} }
// protected // protected
const ByteArray16 IPAddressV6::fetchMask(size_t numBits) { ByteArray16 IPAddressV6::fetchMask(size_t numBits) {
static const size_t bits = bitCount(); static const size_t bits = bitCount();
if (numBits > bits) { if (numBits > bits) {
throw IPAddressFormatException("IPv6 addresses are 128 bits."); throw IPAddressFormatException("IPv6 addresses are 128 bits.");
......
...@@ -338,7 +338,7 @@ class IPAddressV6 { ...@@ -338,7 +338,7 @@ class IPAddressV6 {
* @throws abort if numBits == 0 or numBits > bitCount() * @throws abort if numBits == 0 or numBits > bitCount()
* @return mask associated with numBits * @return mask associated with numBits
*/ */
static const ByteArray16 fetchMask(size_t numBits); static ByteArray16 fetchMask(size_t numBits);
// Given 2 IPAddressV6,mask pairs extract the longest common IPAddress, // Given 2 IPAddressV6,mask pairs extract the longest common IPAddress,
// mask pair // mask pair
static CIDRNetworkV6 longestCommonPrefix( static CIDRNetworkV6 longestCommonPrefix(
......
...@@ -45,7 +45,7 @@ std::string decodeOpenSSLError( ...@@ -45,7 +45,7 @@ std::string decodeOpenSSLError(
} }
} }
const StringPiece getSSLErrorString(SSLError error) { StringPiece getSSLErrorString(SSLError error) {
StringPiece ret; StringPiece ret;
switch (error) { switch (error) {
case SSLError::CLIENT_RENEGOTIATION: case SSLError::CLIENT_RENEGOTIATION:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment