From 2205f7b767c739e06234c1a6cf63462f4059f814 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 10 Dec 2020 18:59:14 +0000 Subject: Tidy container move check Also suppress invalidContainer warning as that's exactly when the check is doing. --- libodbcpp/odbc-param.cpp | 8 ++++---- 1 file 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(); } -- cgit v1.2.3