~singpolyma/biboumi

be9c577de840c7f0dc08b9f5b9ba9bd522d0e2ea — louiz’ 5 years ago b82a14f
Apply all the clang-tidy performance-* fixes
M src/bridge/bridge.cpp => src/bridge/bridge.cpp +3 -3
@@ 988,16 988,16 @@ void Bridge::send_room_history(const std::string& hostname, const std::string& c
    this->send_room_history(hostname, chan_name, resource);
}

void Bridge::send_room_history(const std::string& hostname, const std::string& chan_name, const std::string& resource)
void Bridge::send_room_history(const std::string& hostname, std::string chan_name, const std::string& resource)
{
#ifdef USE_DATABASE
  const auto coptions = Database::get_irc_channel_options_with_server_and_global_default(this->user_jid, hostname, chan_name);
  const auto lines = Database::get_muc_logs(this->user_jid, chan_name, hostname, coptions.maxHistoryLength.value());
  chan_name.append(utils::empty_if_fixed_server("%" + hostname));
  for (const auto& line: lines)
    {
      const auto seconds = line.date.value().timeStamp();
      this->xmpp.send_history_message(chan_name + utils::empty_if_fixed_server("%" + hostname), line.nick.value(),
                                      line.body.value(),
      this->xmpp.send_history_message(chan_name, line.nick.value(), line.body.value(),
                                      this->user_jid + "/" + resource, seconds);
    }
#endif

M src/bridge/bridge.hpp => src/bridge/bridge.hpp +1 -1
@@ 157,7 157,7 @@ public:
   * Send the MUC history to the user
   */
  void send_room_history(const std::string& hostname, const std::string& chan_name);
  void send_room_history(const std::string& hostname, const std::string& chan_name, const std::string& resource);
  void send_room_history(const std::string& hostname, std::string chan_name, const std::string& resource);
  /**
   * Send a MUC message from some participant
   */

M src/irc/irc_client.cpp => src/irc/irc_client.cpp +2 -2
@@ 385,7 385,7 @@ void IrcClient::send_message(IrcMessage&& message)
  res += message.command;
  for (const std::string& arg: message.arguments)
    {
      if (arg.find(" ") != std::string::npos ||
      if (arg.find(' ') != std::string::npos ||
          (!arg.empty() && arg[0] == ':'))
        {
          res += " :" + arg;


@@ 1080,7 1080,7 @@ void IrcClient::on_channel_mode(const IrcMessage& message)
            {
              // That mode can also be of type B if it is present in the
              // prefix_to_mode map
              for (const std::pair<char, char>& pair: this->prefix_to_mode)
              for (const auto& pair: this->prefix_to_mode)
                if (pair.second == c)
                  {
                    type = 1;

M src/network/credentials_manager.cpp => src/network/credentials_manager.cpp +1 -1
@@ 44,7 44,7 @@ const std::string& BasicCredentialsManager::get_trusted_fingerprint() const

void check_tls_certificate(const std::vector<Botan::X509_Certificate>& certs,
                           const std::string& hostname, const std::string& trusted_fingerprint,
                           std::exception_ptr exc)
                           const std::exception_ptr& exc)
{

  if (!trusted_fingerprint.empty() && !certs.empty() &&

M src/network/credentials_manager.hpp => src/network/credentials_manager.hpp +1 -1
@@ 19,7 19,7 @@ class TCPSocketHandler;
 */
void check_tls_certificate(const std::vector<Botan::X509_Certificate>& certs,
                           const std::string& hostname, const std::string& trusted_fingerprint,
                           std::exception_ptr exc);
                           const std::exception_ptr& exc);

class BasicCredentialsManager: public Botan::Credentials_Manager
{

M src/xmpp/xmpp_component.cpp => src/xmpp/xmpp_component.cpp +1 -1
@@ 445,7 445,7 @@ void XmppComponent::send_muc_leave(const std::string& muc_name, const std::strin
    presence["to"] = jid_to;
    presence["from"] = muc_name + "@" + this->served_hostname + "/" + nick;
    presence["type"] = "unavailable";
    const std::string message_str = std::get<0>(message);
    const std::string& message_str = std::get<0>(message);
    XmlSubNode x(presence, "x");
    x["xmlns"] = MUC_USER_NS;
    if (self)

M src/xmpp/xmpp_stanza.cpp => src/xmpp/xmpp_stanza.cpp +1 -1
@@ 52,7 52,7 @@ XmlNode::XmlNode(const std::string& name, XmlNode* parent):
  parent(parent)
{
  // split the namespace and the name
  auto n = name.rfind(":");
  auto n = name.rfind(':');
  if (n == std::string::npos)
    this->name = name;
  else