From: Otto Moerbeek Date: Fri, 3 Feb 2023 08:02:59 +0000 (+0100) Subject: Use back() instead of computing the last offset X-Git-Tag: dnsdist-1.8.0-rc1~38^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d2a86c4284dff3b9e67db886f55798758613a8e;p=thirdparty%2Fpdns.git Use back() instead of computing the last offset --- diff --git a/pdns/logger.cc b/pdns/logger.cc index 00d94906e0..ce0cbafa22 100644 --- a/pdns/logger.cc +++ b/pdns/logger.cc @@ -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;