From c7f6ffccbdefba86afbe20b7f4d668fff2aaecd4 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 1 Oct 2022 22:02:45 +0100 Subject: Replace *foo.rbegin() with foo.end(). --- src/modules/m_abbreviation.cpp | 2 +- src/modules/m_cap.cpp | 3 +-- src/modules/m_spanningtree/fjoin.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/modules') 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(); } -- cgit v1.3.1-10-gc9f91