aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-10-01 22:02:45 +0100
committerGravatar Sadie Powell2022-10-01 22:15:23 +0100
commitc7f6ffccbdefba86afbe20b7f4d668fff2aaecd4 (patch)
tree087572776e63e04c8f7871eba5282ab95aed180d /src
parentRelease v4.0.0 alpha 15. (diff)
downloadinspircd++-c7f6ffccbdefba86afbe20b7f4d668fff2aaecd4.tar.gz
inspircd++-c7f6ffccbdefba86afbe20b7f4d668fff2aaecd4.tar.bz2
inspircd++-c7f6ffccbdefba86afbe20b7f4d668fff2aaecd4.zip
Replace *foo.rbegin() with foo.end().
Diffstat (limited to 'src')
-rw-r--r--src/coremods/core_message.cpp4
-rw-r--r--src/modules/m_abbreviation.cpp2
-rw-r--r--src/modules/m_cap.cpp3
-rw-r--r--src/modules/m_spanningtree/fjoin.cpp2
4 files changed, 5 insertions, 6 deletions
diff --git a/src/coremods/core_message.cpp b/src/coremods/core_message.cpp
index 40aee06d9..684c2c578 100644
--- a/src/coremods/core_message.cpp
+++ b/src/coremods/core_message.cpp
@@ -42,7 +42,7 @@ public:
return false;
size_t end_of_name = text.find(' ', 2);
- size_t end_of_ctcp = *text.rbegin() == '\x1' ? 1 : 0;
+ size_t end_of_ctcp = text.back() == '\x1' ? 1 : 0;
if (end_of_name == std::string::npos)
{
// The CTCP only contains a name.
@@ -76,7 +76,7 @@ public:
if (end_of_name == std::string::npos)
{
// The CTCP only contains a name.
- size_t end_of_ctcp = *text.rbegin() == '\x1' ? 1 : 0;
+ size_t end_of_ctcp = text.back() == '\x1' ? 1 : 0;
name = insp::substring_view(text, text.begin() + 1, text.end() - end_of_ctcp);
return true;
}
diff --git a/src/modules/m_abbreviation.cpp b/src/modules/m_abbreviation.cpp
index 4517e6a45..7cc0deb41 100644
--- a/src/modules/m_abbreviation.cpp
+++ b/src/modules/m_abbreviation.cpp
@@ -46,7 +46,7 @@ public:
ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated) override
{
/* Command is already validated, has a length of 0, or last character is not a . */
- if (validated || command.empty() || *command.rbegin() != '.')
+ if (validated || command.empty() || command.back() != '.')
return MOD_RES_PASSTHRU;
/* Look for any command that starts with the same characters, if it does, replace the command string with it */
diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp
index 745c5f847..c23f98ad5 100644
--- a/src/modules/m_cap.cpp
+++ b/src/modules/m_cap.cpp
@@ -337,8 +337,7 @@ void Cap::ExtItem::FromInternal(Extensible* container, const std::string& value)
return; // Can't happen
// Process the cap protocol version which is a single character at the end of the serialized string
- const char verchar = *value.rbegin();
- if (verchar == '2')
+ if (value.back() == '2')
managerimpl->Set302Protocol(user);
// Remove the version indicator from the string passed to HandleReq
diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp
index a478094b2..7aba0a379 100644
--- a/src/modules/m_spanningtree/fjoin.cpp
+++ b/src/modules/m_spanningtree/fjoin.cpp
@@ -314,7 +314,7 @@ void CommandFJoin::Builder::clear()
const std::string& CommandFJoin::Builder::finalize()
{
- if (*content.rbegin() == ' ')
+ if (content.back() == ' ')
content.erase(content.size()-1);
return str();
}