From b8ddecf41c8938136b3f4a081e1b8a98584c2401 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 16 Feb 2019 14:20:26 +0000 Subject: Modernize clang tidy fixes --- libmysqlpp/my-command.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libmysqlpp/my-command.cpp') diff --git a/libmysqlpp/my-command.cpp b/libmysqlpp/my-command.cpp index 4ad00fc..c296be4 100644 --- a/libmysqlpp/my-command.cpp +++ b/libmysqlpp/my-command.cpp @@ -1,7 +1,7 @@ #include "my-command.h" #include "my-connection.h" -#include -#include +#include +#include MySQL::Command::Command(const Connection * conn, const std::string & sql) : DB::Command(sql), @@ -18,17 +18,17 @@ MySQL::Command::Command(const Connection * conn, const std::string & sql) : binds.resize(mysql_stmt_param_count(stmt)); if (binds.size()) { paramsNeedBinding = true; - for (Binds::iterator i = binds.begin(); i != binds.end(); ++i) { - memset(&*i, 0, sizeof(MYSQL_BIND)); - i->buffer_type = MYSQL_TYPE_NULL; + for (auto & b : binds) { + memset(&b, 0, sizeof(MYSQL_BIND)); + b.buffer_type = MYSQL_TYPE_NULL; } } } MySQL::Command::~Command() { - for (Binds::const_iterator i = binds.begin(); i != binds.end(); ++i) { - free(i->buffer); + for (auto & b : binds) { + free(b.buffer); } mysql_stmt_close(stmt); } @@ -162,7 +162,7 @@ void MySQL::Command::bindNull(unsigned int n) { binds[n].buffer_type = MYSQL_TYPE_NULL; - binds[n].buffer = NULL; + binds[n].buffer = nullptr; free(binds[n].buffer); } -- cgit v1.2.3