From 6d2a86c4284dff3b9e67db886f55798758613a8e Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 3 Feb 2023 09:02:59 +0100 Subject: [PATCH] Use back() instead of computing the last offset --- pdns/logger.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.2