table: Pit::erase accepts Entry* instead of shared_ptr
refs #3164 Change-Id: I9ff47c80865da42b09870c632707dffd78ed76b9
This commit is contained in:
1 parent
3248205bb7
commit
dbef6dc8e2
8 files changed
+21
-18
No files matched your search
@@ -95,17 +95,18 @@ Entry::insertPitEntry(shared_ptr<pit::Entry> pitEntry)
|
||||
}
|
||||
|
||||
void
|
||||
Entry::erasePitEntry(shared_ptr<pit::Entry> pitEntry)
|
||||
Entry::erasePitEntry(pit::Entry* pitEntry)
|
||||
{
|
||||
BOOST_ASSERT(pitEntry != nullptr);
|
||||
BOOST_ASSERT(pitEntry->m_nameTreeEntry == this);
|
||||
|
||||
auto it = std::find(m_pitEntries.begin(), m_pitEntries.end(), pitEntry);
|
||||
auto it = std::find_if(m_pitEntries.begin(), m_pitEntries.end(),
|
||||
[pitEntry] (const shared_ptr<pit::Entry>& pitEntry2) { return pitEntry2.get() == pitEntry; });
|
||||
BOOST_ASSERT(it != m_pitEntries.end());
|
||||
|
||||
*it = m_pitEntries.back();
|
||||
pitEntry->m_nameTreeEntry = nullptr; // must be done before pitEntry is deallocated
|
||||
*it = m_pitEntries.back(); // may deallocate pitEntry
|
||||
m_pitEntries.pop_back();
|
||||
pitEntry->m_nameTreeEntry = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in new issue
Block a user