From 9203f40f41e4a735d379d13867d277c696fb28c5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 3 Sep 2022 22:52:53 +0100 Subject: Fix some warnings noticed by the readability-* clang-tidy checkers. --- src/modules/m_spanningtree/capab.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/modules/m_spanningtree/capab.cpp') diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index bd9e3138d..08533f5a8 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -201,7 +201,9 @@ namespace return true; bool okay; - std::ostringstream diffconfig, localmissing, remotemissing; + std::ostringstream diffconfig; + std::ostringstream localmissing; + std::ostringstream remotemissing; if (protocol <= PROTO_INSPIRCD_3) okay = CompareModulesOld(property, *remote, diffconfig, localmissing, remotemissing); else @@ -418,7 +420,7 @@ void TreeSocket::ListDifference(const std::string &one, const std::string &two, bool TreeSocket::Capab(const CommandBase::Params& params) { - if (params.size() < 1) + if (params.empty()) { this->SendError("Invalid number of parameters for CAPAB - Mismatched version"); return false; @@ -471,7 +473,8 @@ bool TreeSocket::Capab(const CommandBase::Params& params) { if (capab->ChanModes != BuildModeList(MODETYPE_CHANNEL)) { - std::string diffIneed, diffUneed; + std::string diffIneed; + std::string diffUneed; ListDifference(capab->ChanModes, BuildModeList(MODETYPE_CHANNEL), ' ', diffIneed, diffUneed); if (diffIneed.length() || diffUneed.length()) { @@ -489,7 +492,8 @@ bool TreeSocket::Capab(const CommandBase::Params& params) { if (capab->UserModes != BuildModeList(MODETYPE_USER)) { - std::string diffIneed, diffUneed; + std::string diffIneed; + std::string diffUneed; ListDifference(capab->UserModes, BuildModeList(MODETYPE_USER), ' ', diffIneed, diffUneed); if (diffIneed.length() || diffUneed.length()) { -- cgit v1.3.1-10-gc9f91