Change some parms to reference-to-const to satisfy cppcheck

This commit is contained in:
Martin Vierula 2023-05-11 15:06:25 -07:00
parent da8782ce72
commit 2121938c51
No known key found for this signature in database
GPG Key ID: F2FC4E45883BCBA4
3 changed files with 4 additions and 5 deletions

View File

@ -37,7 +37,7 @@ namespace backend {
#ifdef WITH_LMDB
LMDB::LMDB(std::string name) :
LMDB::LMDB(const std::string &name) :
Collection(name), m_env(NULL), isOpen(false) {}
int LMDB::txn_begin(unsigned int flags, MDB_txn **ret) {
@ -60,7 +60,7 @@ void LMDB::string2val(const std::string& str, MDB_val *val) {
}
void LMDB::lmdb_debug(int rc, std::string op, std::string scope) {
void LMDB::lmdb_debug(int rc, const std::string &op, const std::string &scope) {
#ifndef LMDB_STDOUT_COUT
return;
#else

View File

@ -97,7 +97,7 @@ class MDBEnvProvider {
class LMDB :
public Collection {
public:
explicit LMDB(std::string name);
explicit LMDB(const std::string &name);
void store(std::string key, std::string value) override;
bool storeOrUpdateFirst(const std::string &key,
@ -122,7 +122,7 @@ class LMDB :
private:
int txn_begin(unsigned int flags, MDB_txn **ret);
void string2val(const std::string& str, MDB_val *val);
void inline lmdb_debug(int rc, std::string op, std::string scope);
void inline lmdb_debug(int rc, const std::string &op, const std::string &scope);
MDB_env *m_env;
MDB_dbi m_dbi;

View File

@ -68,7 +68,6 @@ uninitvar:src/operators/verify_svnr.cc:67
functionConst:src/collection/backend/lmdb.h:86
unusedLabel:src/collection/backend/lmdb.cc:297
passedByValue:src/collection/backend/lmdb.cc
variableScope:src/operators/rx.cc
variableScope:src/operators/rx_global.cc