Skip to content

Commit

Permalink
ProgramMemory: removed unused insert() functions
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Jul 29, 2024
1 parent f4ecd32 commit 051fab6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
19 changes: 0 additions & 19 deletions lib/programmemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,6 @@ void ProgramMemory::replace(ProgramMemory pm)
}
}

void ProgramMemory::insert(const ProgramMemory &pm)
{
if (pm.empty())
return;

copyOnWrite();

for (auto&& p : pm)
mValues->insert(p);
}

void ProgramMemory::copyOnWrite()
{
if (mValues.use_count() == 1)
Expand Down Expand Up @@ -483,14 +472,6 @@ ProgramMemoryState::ProgramMemoryState(const Settings* s) : settings(s)
assert(settings != nullptr);
}

void ProgramMemoryState::insert(const ProgramMemory &pm, const Token* origin)
{
if (origin)
for (auto&& p : pm)
origins.insert(std::make_pair(p.first.getExpressionId(), origin));
state.insert(pm);
}

void ProgramMemoryState::replace(ProgramMemory pm, const Token* origin)
{
if (origin)
Expand Down
3 changes: 0 additions & 3 deletions lib/programmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ struct CPPCHECKLIB ProgramMemory {

void replace(ProgramMemory pm);

void insert(const ProgramMemory &pm);

Map::iterator begin() {
copyOnWrite();

Expand Down Expand Up @@ -175,7 +173,6 @@ struct ProgramMemoryState {

explicit ProgramMemoryState(const Settings* s);

void insert(const ProgramMemory &pm, const Token* origin = nullptr);
void replace(ProgramMemory pm, const Token* origin = nullptr);

void addState(const Token* tok, const ProgramMemory::Map& vars);
Expand Down

0 comments on commit 051fab6

Please sign in to comment.