summaryrefslogtreecommitdiff
path: root/libpqpp/pq-prepared.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-08-04 19:48:20 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2025-08-04 19:48:20 +0100
commit3526af7ec50e46aaa73d038566f42554f70f27b0 (patch)
tree2591708ced4743213f77c9aa4ee8933dc0d1b333 /libpqpp/pq-prepared.cpp
parentPedantic only with gcc (diff)
downloadlibdbpp-postgresql-3526af7ec50e46aaa73d038566f42554f70f27b0.tar.bz2
libdbpp-postgresql-3526af7ec50e46aaa73d038566f42554f70f27b0.tar.xz
libdbpp-postgresql-3526af7ec50e46aaa73d038566f42554f70f27b0.zip
Fix a lot of clang-tidy warningsHEADlibdbpp-postgresql-1.4.10main
Diffstat (limited to 'libpqpp/pq-prepared.cpp')
-rw-r--r--libpqpp/pq-prepared.cpp9
1 files changed, 4 insertions, 5 deletions
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 <utility>
#include <vector>
-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);