Skip to content

Commit

Permalink
Restored original del func on mock_table
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
  • Loading branch information
vivekrnv committed May 20, 2022
1 parent 8a3c138 commit dfcba64
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/mock_tests/mock_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ namespace swss
table[key] = values;
}

void Table::del(const std::string &key, const std::string& /* op */, const std::string& /*prefix*/)
{
auto &table = gDB[m_pipe->getDbId()][getTableName()];
table.erase(key);
}

void Table::getKeys(std::vector<std::string> &keys)
{
keys.clear();
Expand All @@ -80,6 +74,14 @@ namespace swss
}
}

void Table::del(const std::string &key, const std::string& /* op */, const std::string& /*prefix*/)
{
auto table = gDB[m_pipe->getDbId()].find(getTableName());
if (table != gDB[m_pipe->getDbId()].end()){
table->second.erase(key);
}
}

void ProducerStateTable::set(const std::string &key,
const std::vector<FieldValueTuple> &values,
const std::string &op,
Expand Down

0 comments on commit dfcba64

Please sign in to comment.