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

std::move improvements

Summary: Pull Request resolved: https://github.com/facebook/folly/pull/1298

Reviewed By: igorsugak

Differential Revision: D19281240

Pulled By: yfeldblum

fbshipit-source-id: 3bf437d49aa85b40923ff1ad93ba62fa97b726af
parent bedf2a2d
......@@ -222,7 +222,7 @@ IPAddress::IPAddress(StringPiece str) : addr_(), family_(AF_UNSPEC) {
throw IPAddressFormatException(
to<std::string>("Invalid IP address '", str, "'"));
}
*this = std::move(maybeIp.value());
*this = maybeIp.value();
}
Expected<IPAddress, IPAddressFormatError> IPAddress::tryFromString(
......
......@@ -90,7 +90,7 @@ IPAddressV4::IPAddressV4(StringPiece addr) : addr_() {
throw IPAddressFormatException(
to<std::string>("Invalid IPv4 address '", addr, "'"));
}
*this = std::move(maybeIp.value());
*this = maybeIp.value();
}
Expected<IPAddressV4, IPAddressFormatError> IPAddressV4::tryFromString(
......@@ -120,7 +120,7 @@ Expected<IPAddressV4, IPAddressFormatError> IPAddressV4::tryFromBinary(
IPAddressV4 addr;
auto setResult = addr.trySetFromBinary(bytes);
if (setResult.hasError()) {
return makeUnexpected(std::move(setResult.error()));
return makeUnexpected(setResult.error());
}
return addr;
}
......
......@@ -76,7 +76,7 @@ IPAddressV6::IPAddressV6(StringPiece addr) {
throw IPAddressFormatException(
to<std::string>("Invalid IPv6 address '", addr, "'"));
}
*this = std::move(maybeIp.value());
*this = maybeIp.value();
}
Expected<IPAddressV6, IPAddressFormatError> IPAddressV6::tryFromString(
......@@ -180,7 +180,7 @@ Expected<IPAddressV6, IPAddressFormatError> IPAddressV6::tryFromBinary(
IPAddressV6 addr;
auto setResult = addr.trySetFromBinary(bytes);
if (setResult.hasError()) {
return makeUnexpected(std::move(setResult.error()));
return makeUnexpected(setResult.error());
}
return addr;
}
......
......@@ -87,10 +87,7 @@ auto FiberManager::FrozenOptions::create(const Options& options) -> ssize_t {
FiberManager::FiberManager(
std::unique_ptr<LoopController> loopController,
Options options)
: FiberManager(
LocalType<void>(),
std::move(loopController),
std::move(options)) {}
: FiberManager(LocalType<void>(), std::move(loopController), options) {}
FiberManager::~FiberManager() {
loopController_.reset();
......
......@@ -1059,7 +1059,7 @@ void AsyncServerSocket::dispatchError(const char* msgstr, int errnoValue) {
QueueMessage msg;
msg.type = MessageType::MSG_ERROR;
msg.err = errnoValue;
msg.msg = std::move(msgstr);
msg.msg = msgstr;
while (true) {
// Short circuit if the callback is in the primary EventBase thread
......
......@@ -74,7 +74,7 @@ MemoryMapping::MemoryMapping(
off_t offset,
off_t length,
Options options)
: file_(std::move(file)), options_(std::move(options)) {
: file_(std::move(file)), options_(options) {
CHECK(file_);
init(offset, length);
}
......@@ -98,7 +98,7 @@ MemoryMapping::MemoryMapping(
: MemoryMapping(File(fd), offset, length, options) {}
MemoryMapping::MemoryMapping(AnonymousType, off_t length, Options options)
: options_(std::move(options)) {
: options_(options) {
init(0, length);
}
......
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