diff --git a/common/configdb.cpp b/common/configdb.cpp index aba46d302..743cdc907 100644 --- a/common/configdb.cpp +++ b/common/configdb.cpp @@ -180,10 +180,11 @@ map> ConfigDBConnector_Native::get_table(string tabl auto const& entry = client.hgetall>(key); size_t pos = key.find(TABLE_NAME_SEPARATOR); string row; - if (pos != string::npos) + if (pos == string::npos) { - row = key.substr(pos + 1); + continue; } + row = key.substr(pos + 1); data[row] = entry; } return data; @@ -410,10 +411,11 @@ int ConfigDBPipeConnector_Native::_get_config(DBConnector& client, RedisTransact size_t pos = key.find(TABLE_NAME_SEPARATOR); string table_name = key.substr(0, pos); string row; - if (pos != string::npos) + if (pos == string::npos) { - row = key.substr(pos + 1); + continue; } + row = key.substr(pos + 1); auto reply = pipe.dequeueReply(); RedisReply r(reply);