Skip to content

Commit 2121938

Browse files
committed
Change some parms to reference-to-const to satisfy cppcheck
1 parent da8782c commit 2121938

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

Diff for: src/collection/backend/lmdb.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace backend {
3737

3838
#ifdef WITH_LMDB
3939

40-
LMDB::LMDB(std::string name) :
40+
LMDB::LMDB(const std::string &name) :
4141
Collection(name), m_env(NULL), isOpen(false) {}
4242

4343
int LMDB::txn_begin(unsigned int flags, MDB_txn **ret) {
@@ -60,7 +60,7 @@ void LMDB::string2val(const std::string& str, MDB_val *val) {
6060
}
6161

6262

63-
void LMDB::lmdb_debug(int rc, std::string op, std::string scope) {
63+
void LMDB::lmdb_debug(int rc, const std::string &op, const std::string &scope) {
6464
#ifndef LMDB_STDOUT_COUT
6565
return;
6666
#else

Diff for: src/collection/backend/lmdb.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class MDBEnvProvider {
9797
class LMDB :
9898
public Collection {
9999
public:
100-
explicit LMDB(std::string name);
100+
explicit LMDB(const std::string &name);
101101
void store(std::string key, std::string value) override;
102102

103103
bool storeOrUpdateFirst(const std::string &key,
@@ -122,7 +122,7 @@ class LMDB :
122122
private:
123123
int txn_begin(unsigned int flags, MDB_txn **ret);
124124
void string2val(const std::string& str, MDB_val *val);
125-
void inline lmdb_debug(int rc, std::string op, std::string scope);
125+
void inline lmdb_debug(int rc, const std::string &op, const std::string &scope);
126126

127127
MDB_env *m_env;
128128
MDB_dbi m_dbi;

Diff for: test/cppcheck_suppressions.txt

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ uninitvar:src/operators/verify_svnr.cc:67
6868
functionConst:src/collection/backend/lmdb.h:86
6969
unusedLabel:src/collection/backend/lmdb.cc:297
7070

71-
passedByValue:src/collection/backend/lmdb.cc
7271
variableScope:src/operators/rx.cc
7372
variableScope:src/operators/rx_global.cc
7473

0 commit comments

Comments
 (0)