1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

redis: fix cppcheck warnings

This commit is contained in:
Steffen Vogel 2021-07-20 21:05:54 +02:00
parent 198e4a3c51
commit 110ec81cc6
2 changed files with 5 additions and 5 deletions

View file

@ -64,7 +64,7 @@ protected:
std::thread thread;
std::atomic<enum State> state;
void onMessage(std::string channel, std::string msg);
void onMessage(const std::string &channel, const std::string &msg);
void loop();

View file

@ -38,7 +38,7 @@
/* Forward declartions */
static struct vnode_type p;
static void redis_on_message(struct vnode *n, std::string channel, std::string msg);
static void redis_on_message(struct vnode *n, const std::string &channel, const std::string &msg);
using namespace villas;
using namespace villas::node;
@ -55,7 +55,7 @@ RedisConnection::RedisConnection(const ConnectionOptions &opts) :
/* Enable keyspace notifications */
context.command("config", "set", "notify-keyspace-events", "K$h");
subscriber.on_message([this](std::string channel, std::string msg) {
subscriber.on_message([this](const std::string &channel, const std::string &msg) {
onMessage(channel, msg);
});
@ -84,7 +84,7 @@ RedisConnection * RedisConnection::get(const ConnectionOptions &opts)
return conn;
}
void RedisConnection::onMessage(std::string channel, std::string msg)
void RedisConnection::onMessage(const std::string &channel, const std::string &msg)
{
auto itp = subscriberMap.equal_range(channel);
for (auto it = itp.first; it != itp.second; ++it) {
@ -218,7 +218,7 @@ static int redis_get(struct vnode *n, struct sample * const smps[], unsigned cnt
}
}
static void redis_on_message(struct vnode *n, std::string channel, std::string msg)
static void redis_on_message(struct vnode *n, const std::string &channel, const std::string &msg)
{
struct redis *r = (struct redis *) n->_vd;