debugger: Slightly optimize symbol list updates

This commit is contained in:
Exzap 2024-07-26 03:31:42 +02:00
parent 026d547dcc
commit 252429933f

View File

@ -46,25 +46,25 @@ SymbolListCtrl::SymbolListCtrl(wxWindow* parent, const wxWindowID& id, const wxP
void SymbolListCtrl::OnGameLoaded()
{
m_data.clear();
long itemId = 0;
const auto symbol_map = rplSymbolStorage_lockSymbolMap();
for (auto const& [address, symbol_info] : symbol_map)
{
if (symbol_info == nullptr || symbol_info->symbolName == nullptr)
continue;
wxString libNameWX = wxString::FromAscii((const char*)symbol_info->libName);
wxString symbolNameWX = wxString::FromAscii((const char*)symbol_info->symbolName);
wxString searchNameWX = libNameWX + symbolNameWX;
searchNameWX.MakeLower();
auto new_entry = m_data.try_emplace(
symbol_info->address,
(char*)(symbol_info->symbolName),
(char*)(symbol_info->libName),
"",
symbolNameWX,
libNameWX,
searchNameWX,
false
);
new_entry.first->second.searchName += new_entry.first->second.name;
new_entry.first->second.searchName += new_entry.first->second.libName;
new_entry.first->second.searchName.MakeLower();
if (m_list_filter.IsEmpty())
new_entry.first->second.visible = true;
else if (new_entry.first->second.searchName.Contains(m_list_filter))