Skip to content

Commit

Permalink
Fix redundant std::move(). (#49)
Browse files Browse the repository at this point in the history
This commit removes the following warnings.

redisclient/src/redisclient/impl/redisclientimpl.cpp:263:24:
warning: moving a temporary object prevents copy elision
[-Wpessimizing-move]

data.push_back(std::move(makeCommand(command)));
               ^
  • Loading branch information
redboltz authored and nekipelov committed Oct 27, 2017
1 parent 2b8e977 commit 14b58ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/redisclient/impl/redisclientimpl.cpp
Expand Up @@ -260,7 +260,7 @@ RedisValue RedisClientImpl::doSyncCommand(const std::deque<std::deque<RedisBuffe

for(const auto &command: commands)
{
data.push_back(std::move(makeCommand(command)));
data.push_back(makeCommand(command));
buffers.push_back(boost::asio::buffer(data.back()));
}

Expand All @@ -276,7 +276,7 @@ RedisValue RedisClientImpl::doSyncCommand(const std::deque<std::deque<RedisBuffe

for(size_t i = 0; i < commands.size(); ++i)
{
responses.push_back(std::move(syncReadResponse()));
responses.push_back(syncReadResponse());
}

return RedisValue(std::move(responses));
Expand Down Expand Up @@ -348,7 +348,7 @@ void RedisClientImpl::asyncRead(const boost::system::error_code &ec, const size_

if( result.second == RedisParser::Completed )
{
doProcessMessage(std::move(redisParser.result()));
doProcessMessage(redisParser.result());
}
else if( result.second == RedisParser::Incompleted )
{
Expand Down Expand Up @@ -437,8 +437,8 @@ void RedisClientImpl::singleShotSubscribe(
}
}

void RedisClientImpl::unsubscribe(const std::string &command,
size_t handleId,
void RedisClientImpl::unsubscribe(const std::string &command,
size_t handleId,
const std::string &channel,
std::function<void(RedisValue)> handler)
{
Expand Down

0 comments on commit 14b58ef

Please sign in to comment.