From 3526af7ec50e46aaa73d038566f42554f70f27b0 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 4 Aug 2025 19:48:20 +0100 Subject: Fix a lot of clang-tidy warnings --- libpqpp/pq-prepared.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libpqpp/pq-prepared.cpp') diff --git a/libpqpp/pq-prepared.cpp b/libpqpp/pq-prepared.cpp index 8678c11..defcee1 100644 --- a/libpqpp/pq-prepared.cpp +++ b/libpqpp/pq-prepared.cpp @@ -9,8 +9,8 @@ #include #include -PQ::PreparedStatement::PreparedStatement(Connection * c, const std::string & sql, const DB::CommandOptionsCPtr & opts) : - DB::Command(sql), Command(c, sql, opts), pstmt(nullptr) +PQ::PreparedStatement::PreparedStatement(Connection * conn, const std::string & sql, + const DB::CommandOptionsCPtr & opts) : DB::Command(sql), Command(conn, sql, opts), pstmt(nullptr) { } @@ -20,9 +20,8 @@ PQ::PreparedStatement::prepare() const if (pstmt) { return pstmt; } - auto i = c->preparedStatements.find(hash); - if (i != c->preparedStatements.end()) { - return (pstmt = i->second.c_str()); + if (auto existingItr = c->preparedStatements.find(hash); existingItr != c->preparedStatements.end()) { + return (pstmt = existingItr->second.c_str()); } std::stringstream psql; prepareSql(psql, sql); -- cgit v1.2.3