[wpiutil] Replace LLVM StringMap impl with std::map

As string_view operations on std::map<std::string> won't be integrated
until C++26, placeholder implementations are used which are less efficient
in a couple of situations (e.g. insert with hint).
This commit is contained in:
Peter Johnson
2024-10-23 21:33:12 -07:00
parent 5f3cf517d3
commit f620141e0d
34 changed files with 944 additions and 2031 deletions

View File

@@ -112,8 +112,8 @@ void HALSimWS::Start() {
// Print any filters we are using
if (m_useMsgFiltering) {
wpi::print("WS Message Filters:");
for (auto filter : m_msgFilters.keys()) {
wpi::print("* \"{}\"\n", filter);
for (auto&& filter : m_msgFilters) {
wpi::print("* \"{}\"\n", filter.first);
}
} else {
wpi::print("No WS Message Filters specified");

View File

@@ -54,7 +54,7 @@ void HALSimWSProviderSimDevice::CancelCallbacks() {
m_simValueCreatedCbKey = 0;
for (auto& kv : m_simValueChangedCbKeys) {
HALSIM_CancelSimValueChangedCallback(kv.getValue());
HALSIM_CancelSimValueChangedCallback(kv.second);
}
m_simValueChangedCbKeys.clear();

View File

@@ -40,7 +40,7 @@ class ProviderContainer {
void ForEach(IterFn fn) {
std::shared_lock lock(m_mutex);
for (auto& kv : m_providers) {
fn(kv.getValue());
fn(kv.second);
}
}

View File

@@ -123,8 +123,8 @@ void HALSimWeb::Start() {
// Print any filters we are using
if (m_useMsgFiltering) {
wpi::print("WS Message Filters:");
for (auto filter : m_msgFilters.keys()) {
wpi::print("* \"{}\"\n", filter);
for (auto&& filter : m_msgFilters) {
wpi::print("* \"{}\"\n", filter.first);
}
} else {
wpi::print("No WS Message Filters specified");