summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-12-10 18:59:14 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-12-10 18:59:14 +0000
commit2205f7b767c739e06234c1a6cf63462f4059f814 (patch)
treecc87bd2fdfc223e3d7cf8b56ed4b3cfed42ffb6c
parentClang format (diff)
downloadlibdbpp-odbc-2205f7b767c739e06234c1a6cf63462f4059f814.tar.bz2
libdbpp-odbc-2205f7b767c739e06234c1a6cf63462f4059f814.tar.xz
libdbpp-odbc-2205f7b767c739e06234c1a6cf63462f4059f814.zip
Tidy container move check
Also suppress invalidContainer warning as that's exactly when the check is doing.
-rw-r--r--libodbcpp/odbc-param.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libodbcpp/odbc-param.cpp b/libodbcpp/odbc-param.cpp
index a14d244..cdaf97c 100644
--- a/libodbcpp/odbc-param.cpp
+++ b/libodbcpp/odbc-param.cpp
@@ -75,8 +75,8 @@ ODBC::StdStringParam::operator=(Glib::ustring const & d)
const char * addr = data.data();
data = d;
bindLen = d.bytes();
- paramBound &= (addr == data.data());
- if (!paramBound) {
+ // cppcheck-suppress invalidContainer
+ if (addr != data.data()) {
paramBound = false;
bind();
}
@@ -89,8 +89,8 @@ ODBC::StdStringParam::operator=(std::string_view const & d)
const char * addr = data.data();
data = d;
bindLen = d.length();
- paramBound &= (addr == data.data());
- if (!paramBound) {
+ // cppcheck-suppress invalidContainer
+ if (addr != data.data()) {
paramBound = false;
bind();
}