Apply all the clang-tidy modernize-* fixes

This commit is contained in:
louiz’
2017-04-07 18:45:24 +02:00
parent dd4c54c6cd
commit 5402a256d1
20 changed files with 57 additions and 57 deletions
+3 -2
View File
@@ -1,11 +1,12 @@
#include <utility>
#include <xmpp/adhoc_command.hpp>
#include <xmpp/xmpp_component.hpp>
#include <utils/reload.hpp>
using namespace std::string_literals;
AdhocCommand::AdhocCommand(std::vector<AdhocStep>&& callbacks, const std::string& name, const bool admin_only):
name(name),
AdhocCommand::AdhocCommand(std::vector<AdhocStep>&& callbacks, std::string name, const bool admin_only):
name(std::move(name)),
callbacks(std::move(callbacks)),
admin_only(admin_only)
{
+1 -1
View File
@@ -17,7 +17,7 @@ class AdhocCommand
{
friend class AdhocSession;
public:
AdhocCommand(std::vector<AdhocStep>&& callbacks, const std::string& name, const bool admin_only);
AdhocCommand(std::vector<AdhocStep>&& callbacks, std::string name, const bool admin_only);
~AdhocCommand() = default;
AdhocCommand(const AdhocCommand&) = default;
AdhocCommand(AdhocCommand&&) = default;
+4 -6
View File
@@ -83,10 +83,8 @@ BiboumiComponent::BiboumiComponent(std::shared_ptr<Poller>& poller, const std::s
void BiboumiComponent::shutdown()
{
for (auto it = this->bridges.begin(); it != this->bridges.end(); ++it)
{
it->second->shutdown("Gateway shutdown");
}
for (auto& pair: this->bridges)
pair.second->shutdown("Gateway shutdown");
}
void BiboumiComponent::clean()
@@ -696,8 +694,8 @@ Bridge* BiboumiComponent::find_user_bridge(const std::string& full_jid)
std::vector<Bridge*> BiboumiComponent::get_bridges() const
{
std::vector<Bridge*> res;
for (auto it = this->bridges.begin(); it != this->bridges.end(); ++it)
res.push_back(it->second.get());
for (const auto& bridge: this->bridges)
res.push_back(bridge.second.get());
return res;
}
+1 -1
View File
@@ -53,7 +53,7 @@ std::string jidprep(const std::string& original)
char local[max_jid_part_len] = {};
memcpy(local, jid.local.data(), std::min(max_jid_part_len, jid.local.size()));
Stringprep_rc rc = static_cast<Stringprep_rc>(::stringprep(local, max_jid_part_len,
auto rc = static_cast<Stringprep_rc>(::stringprep(local, max_jid_part_len,
static_cast<Stringprep_profile_flags>(0), stringprep_xmpp_nodeprep));
if (rc != STRINGPREP_OK)
{
+1 -1
View File
@@ -7,7 +7,7 @@
#include <iostream>
#include <sstream>
#include <string.h>
#include <cstring>
std::string xml_escape(const std::string& data)
{