Skip to content

Commit

Permalink
Changing auto& it to const auto& it
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAn0therDev committed Aug 2, 2021
1 parent 014216c commit 5d16030
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions BlackMarlin/black_marlin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <vector>
#include <iostream>
#include <thread>
#include <cassert>

BlackMarlin::BlackMarlin() noexcept
{
Expand All @@ -16,7 +15,7 @@ BlackMarlin::~BlackMarlin() noexcept

const std::string* BlackMarlin::Get(const std::string& p_key) const
{
auto it = this->m_dict.find(p_key);
const auto& it = this->m_dict.find(p_key);

if (it != this->m_dict.end())
{
Expand All @@ -28,7 +27,7 @@ const std::string* BlackMarlin::Get(const std::string& p_key) const

void BlackMarlin::Set(std::string p_key, std::string* p_value)
{
auto it = this->m_dict.find(p_key);
const auto& it = this->m_dict.find(p_key);

if (it == this->m_dict.end())
{
Expand All @@ -38,9 +37,7 @@ void BlackMarlin::Set(std::string p_key, std::string* p_value)

void BlackMarlin::SetToDeleteLater(std::string p_key, std::string* p_value, const uint16_t& p_seconds)
{
auto& p_dict = this->m_dict;

auto& it = this->m_dict.find(p_key);
const auto& it = this->m_dict.find(p_key);

if (it == this->m_dict.end())
{
Expand All @@ -59,7 +56,7 @@ void BlackMarlin::DeleteIn(const std::string& p_key, const uint16_t& p_seconds)

void BlackMarlin::Overwrite(std::string p_key, std::string* p_value)
{
auto& it = this->m_dict.find(p_key);
const auto& it = this->m_dict.find(p_key);

if (it != this->m_dict.end())
{
Expand All @@ -71,7 +68,7 @@ void BlackMarlin::Overwrite(std::string p_key, std::string* p_value)

void BlackMarlin::Delete(const std::string& p_key)
{
auto& it = this->m_dict.find(p_key);
const auto& it = this->m_dict.find(p_key);

if (it == this->m_dict.end()) return;

Expand All @@ -82,7 +79,7 @@ void BlackMarlin::Delete(const std::string& p_key)

const bool BlackMarlin::Exists(const std::string& p_key) const
{
auto it = this->m_dict.find(p_key);
const auto& it = this->m_dict.find(p_key);

if (it != this->m_dict.end())
{
Expand Down

0 comments on commit 5d16030

Please sign in to comment.