Fix compiler warnings don't move local variables

This commit is contained in:
Yonas Habteab 2022-02-22 17:47:54 +01:00
parent db321b9fcb
commit a0607aceff
15 changed files with 25 additions and 25 deletions

View File

@ -194,7 +194,7 @@ String NetString::ReadStringFromStream(const Shared<AsioTlsStream>::Ptr& stream,
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid NetString (missing ,)")); BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid NetString (missing ,)"));
} }
return std::move(payload); return payload;
} }
/** /**
@ -273,7 +273,7 @@ String NetString::ReadStringFromStream(const Shared<AsioTlsStream>::Ptr& stream,
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid NetString (missing ,)")); BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid NetString (missing ,)"));
} }
return std::move(payload); return payload;
} }
/** /**

View File

@ -154,7 +154,7 @@ static const UoMs l_CsUoMs (([]() -> UoMs {
} }
} }
return std::move(uniqUoms); return uniqUoms;
})()); })());
static const UoMs l_CiUoMs (([]() -> UoMs { static const UoMs l_CiUoMs (([]() -> UoMs {
@ -208,7 +208,7 @@ static const UoMs l_CiUoMs (([]() -> UoMs {
} }
} }
return std::move(uniqUoms); return uniqUoms;
})()); })());
PerfdataValue::PerfdataValue(const String& label, double value, bool counter, PerfdataValue::PerfdataValue(const String& label, double value, bool counter,

View File

@ -298,7 +298,7 @@ Shared<boost::asio::ssl::context>::Ptr SetupSslContext(String certPath, String k
} }
} }
return std::move(context); return context;
} }
/** /**

View File

@ -557,7 +557,7 @@ Shared<AsioTlsStream>::Ptr ConsoleCommand::Connect()
throw; throw;
} }
return std::move(stream); return stream;
} }
/** /**

View File

@ -54,7 +54,7 @@ Comment::Ptr Checkable::GetLastComment() const
} }
} }
return std::move(lastComment); return lastComment;
} }
void Checkable::RegisterComment(const Comment::Ptr& comment) void Checkable::RegisterComment(const Comment::Ptr& comment)

View File

@ -554,7 +554,7 @@ std::vector<std::vector<intrusive_ptr<ConfigObject>>> IcingaDB::ChunkObjects(std
chunks.emplace_back(offset, end); chunks.emplace_back(offset, end);
} }
return std::move(chunks); return chunks;
} }
void IcingaDB::DeleteKeys(const RedisConnection::Ptr& conn, const std::vector<String>& keys, RedisConnection::QueryPriority priority) { void IcingaDB::DeleteKeys(const RedisConnection::Ptr& conn, const std::vector<String>& keys, RedisConnection::QueryPriority priority) {
@ -591,7 +591,7 @@ std::vector<String> IcingaDB::GetTypeOverwriteKeys(const String& type)
keys.emplace_back(m_PrefixConfigCheckSum + type + ":argument"); keys.emplace_back(m_PrefixConfigCheckSum + type + ":argument");
} }
return std::move(keys); return keys;
} }
std::vector<String> IcingaDB::GetTypeDumpSignalKeys(const Type::Ptr& type) std::vector<String> IcingaDB::GetTypeDumpSignalKeys(const Type::Ptr& type)
@ -621,7 +621,7 @@ std::vector<String> IcingaDB::GetTypeDumpSignalKeys(const Type::Ptr& type)
keys.emplace_back(m_PrefixConfigObject + lcType + ":argument"); keys.emplace_back(m_PrefixConfigObject + lcType + ":argument");
} }
return std::move(keys); return keys;
} }
template<typename ConfigType> template<typename ConfigType>

View File

@ -598,7 +598,7 @@ std::vector<char> RedisConnection::ReadLine(AsyncReadStream& stream, boost::asio
if (next == '\r') { if (next == '\r') {
asio::async_read(stream, buf, yc); asio::async_read(stream, buf, yc);
return std::move(line); return line;
} }
line.emplace_back(next); line.emplace_back(next);

View File

@ -646,7 +646,7 @@ OptionalTlsStream ElasticsearchWriter::Connect()
} }
} }
return std::move(stream); return stream;
} }
void ElasticsearchWriter::AssertOnWorkQueue() void ElasticsearchWriter::AssertOnWorkQueue()

View File

@ -27,7 +27,7 @@ boost::beast::http::request<boost::beast::http::string_body> Influxdb2Writer::As
request.set(boost::beast::http::field::authorization, "Token " + GetAuthToken()); request.set(boost::beast::http::field::authorization, "Token " + GetAuthToken());
return std::move(request); return request;
} }
Url::Ptr Influxdb2Writer::AssembleUrl() Url::Ptr Influxdb2Writer::AssembleUrl()
@ -40,5 +40,5 @@ Url::Ptr Influxdb2Writer::AssembleUrl()
url->AddQueryElement("org", GetOrganization()); url->AddQueryElement("org", GetOrganization());
url->AddQueryElement("bucket", GetBucket()); url->AddQueryElement("bucket", GetBucket());
return std::move(url); return url;
} }

View File

@ -192,7 +192,7 @@ OptionalTlsStream InfluxdbCommonWriter::Connect()
} }
} }
return std::move(stream); return stream;
} }
void InfluxdbCommonWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr) void InfluxdbCommonWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
@ -540,7 +540,7 @@ boost::beast::http::request<boost::beast::http::string_body> InfluxdbCommonWrite
request.body() = std::move(body); request.body() = std::move(body);
request.content_length(request.body().size()); request.content_length(request.body().size());
return std::move(request); return request;
} }
Url::Ptr InfluxdbCommonWriter::AssembleBaseUrl() Url::Ptr InfluxdbCommonWriter::AssembleBaseUrl()
@ -552,7 +552,7 @@ Url::Ptr InfluxdbCommonWriter::AssembleBaseUrl()
url->SetPort(GetPort()); url->SetPort(GetPort());
url->AddQueryElement("precision", "s"); url->AddQueryElement("precision", "s");
return std::move(url); return url;
} }
void InfluxdbCommonWriter::ValidateHostTemplate(const Lazy<Dictionary::Ptr>& lvalue, const ValidationUtils& utils) void InfluxdbCommonWriter::ValidateHostTemplate(const Lazy<Dictionary::Ptr>& lvalue, const ValidationUtils& utils)

View File

@ -34,7 +34,7 @@ boost::beast::http::request<boost::beast::http::string_body> InfluxdbWriter::Ass
); );
} }
return std::move(request); return request;
} }
Url::Ptr InfluxdbWriter::AssembleUrl() Url::Ptr InfluxdbWriter::AssembleUrl()
@ -52,5 +52,5 @@ Url::Ptr InfluxdbWriter::AssembleUrl()
if (!GetPassword().IsEmpty()) if (!GetPassword().IsEmpty())
url->AddQueryElement("p", GetPassword()); url->AddQueryElement("p", GetPassword());
return std::move(url); return url;
} }

View File

@ -53,7 +53,7 @@ String ConfigObjectUtility::GetObjectConfigPath(const Type::Ptr& type, const Str
* creation early so that configuration inconsistencies throughout the cluster are avoided. * creation early so that configuration inconsistencies throughout the cluster are avoided.
*/ */
if ((type->GetName() != "Comment" && type->GetName() != "Downtime") || Utility::PathExists(longPath)) { if ((type->GetName() != "Comment" && type->GetName() != "Downtime") || Utility::PathExists(longPath)) {
return std::move(longPath); return longPath;
} }
/* Maximum length 80 bytes object name + 3 bytes "..." + 40 bytes SHA1 (hex-encoded) */ /* Maximum length 80 bytes object name + 3 bytes "..." + 40 bytes SHA1 (hex-encoded) */

View File

@ -231,7 +231,7 @@ Dictionary::Ptr EventsInbox::Shift(boost::asio::yield_context yc, double timeout
auto event (std::move(m_Queue.front())); auto event (std::move(m_Queue.front()));
m_Queue.pop(); m_Queue.pop();
return std::move(event); return event;
} }
EventsSubscriber::EventsSubscriber(std::set<EventType> types, String filter, const String& filterSource) EventsSubscriber::EventsSubscriber(std::set<EventType> types, String filter, const String& filterSource)

View File

@ -113,7 +113,7 @@ String JsonRpc::ReadMessage(const Shared<AsioTlsStream>::Ptr& stream, ssize_t ma
std::cerr << ConsoleColorTag(Console_ForegroundBlue) << "<< " << jsonString << ConsoleColorTag(Console_Normal) << "\n"; std::cerr << ConsoleColorTag(Console_ForegroundBlue) << "<< " << jsonString << ConsoleColorTag(Console_Normal) << "\n";
#endif /* I2_DEBUG */ #endif /* I2_DEBUG */
return std::move(jsonString); return jsonString;
} }
/** /**
@ -134,7 +134,7 @@ String JsonRpc::ReadMessage(const Shared<AsioTlsStream>::Ptr& stream, boost::asi
std::cerr << ConsoleColorTag(Console_ForegroundBlue) << "<< " << jsonString << ConsoleColorTag(Console_Normal) << "\n"; std::cerr << ConsoleColorTag(Console_ForegroundBlue) << "<< " << jsonString << ConsoleColorTag(Console_Normal) << "\n";
#endif /* I2_DEBUG */ #endif /* I2_DEBUG */
return std::move(jsonString); return jsonString;
} }
/** /**

View File

@ -206,7 +206,7 @@ static Shared<AsioTlsStream>::Ptr Connect(const String& host, const String& port
throw; throw;
} }
return std::move(stream); return stream;
} }
static const char l_ReasonToInject[2] = {' ', 'X'}; static const char l_ReasonToInject[2] = {' ', 'X'};
@ -223,7 +223,7 @@ boost::asio::mutable_buffer GetFirstNonZeroBuffer(const MutableBufferSequence& m
asio::mutable_buffer buf (*current); asio::mutable_buffer buf (*current);
if (buf.size() > 0u) { if (buf.size() > 0u) {
return std::move(buf); return buf;
} }
} }