Cosmetics: Using VariableValues instead of std::vector<...>

Making the code more readable.
This commit is contained in:
Felipe Zimmerle
2020-08-24 12:57:47 -03:00
parent 6c79e716e7
commit 759fc1eabe
54 changed files with 123 additions and 119 deletions

View File

@@ -86,7 +86,7 @@ void InMemoryPerProcess::del(const std::string& key) {
void InMemoryPerProcess::resolveSingleMatch(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l) {
VariableValues *l) {
auto range = this->equal_range(var);
for (auto it = range.first; it != range.second; ++it) {
@@ -96,7 +96,7 @@ void InMemoryPerProcess::resolveSingleMatch(const std::string& var,
void InMemoryPerProcess::resolveMultiMatches(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l, variables::KeyExclusions &ke) {
VariableValues *l, variables::KeyExclusions &ke) {
size_t keySize = var.size();
l->reserve(15);
@@ -120,7 +120,7 @@ void InMemoryPerProcess::resolveMultiMatches(const std::string& var,
void InMemoryPerProcess::resolveRegularExpression(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l, variables::KeyExclusions &ke) {
VariableValues *l, variables::KeyExclusions &ke) {
//if (var.find(":") == std::string::npos) {
// return;

View File

@@ -87,12 +87,12 @@ class InMemoryPerProcess :
std::unique_ptr<std::string> resolveFirst(const std::string& var) override;
void resolveSingleMatch(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l) override;
VariableValues *l) override;
void resolveMultiMatches(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l,
VariableValues *l,
variables::KeyExclusions &ke) override;
void resolveRegularExpression(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l,
VariableValues *l,
variables::KeyExclusions &ke) override;
private:

View File

@@ -262,7 +262,7 @@ end_txn:
void LMDB::resolveSingleMatch(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l) {
VariableValues *l) {
int rc;
MDB_txn *txn;
MDB_dbi dbi;
@@ -465,7 +465,7 @@ end_txn:
void LMDB::resolveMultiMatches(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l,
VariableValues *l,
variables::KeyExclusions &ke) {
MDB_val key, data;
MDB_txn *txn = NULL;
@@ -527,7 +527,7 @@ end_txn:
void LMDB::resolveRegularExpression(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l,
VariableValues *l,
variables::KeyExclusions &ke) {
MDB_val key, data;
MDB_txn *txn = NULL;

View File

@@ -66,12 +66,12 @@ class LMDB :
std::unique_ptr<std::string> resolveFirst(const std::string& var) override;
void resolveSingleMatch(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l) override;
VariableValues *l) override;
void resolveMultiMatches(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l,
VariableValues *l,
variables::KeyExclusions &ke) override;
void resolveRegularExpression(const std::string& var,
std::vector<std::shared_ptr<const VariableValue>> *l,
VariableValues *l,
variables::KeyExclusions &ke) override;
private: