]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Use back() instead of computing the last offset
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 3 Feb 2023 08:02:59 +0000 (09:02 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 3 Feb 2023 08:02:59 +0000 (09:02 +0100)
pdns/logger.cc

index 00d94906e073b8ebba581b2b7c9d1600422faf31..ce0cbafa22c258957b817e24d251a0396dbef03b 100644 (file)
@@ -206,7 +206,7 @@ Logger& Logger::operator<<(const ComboAddress& ca)
 void addTraceTS(const timeval& start, ostringstream& str)
 {
   const auto& content = str.str();
-  if (content.empty() || content.at(content.size() - 1) == '\n') {
+  if (content.empty() || content.back() == '\n') {
     timeval time{};
     gettimeofday(&time, nullptr);
     auto elapsed = time - start;