[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

@@ -126,7 +126,7 @@ wpi::Sendable* SmartDashboard::GetData(std::string_view key) {
if (it == inst.tablesToData.end()) {
throw FRC_MakeError(err::SmartDashboardMissingKey, "{}", key);
}
return wpi::SendableRegistry::GetSendable(it->getValue());
return wpi::SendableRegistry::GetSendable(it->second);
}
bool SmartDashboard::PutBoolean(std::string_view keyName, bool value) {
@@ -254,6 +254,6 @@ void SmartDashboard::UpdateValues() {
inst.listenerExecutor.RunListenerTasks();
std::scoped_lock lock(inst.tablesToDataMutex);
for (auto& i : inst.tablesToData) {
wpi::SendableRegistry::Update(i.getValue());
wpi::SendableRegistry::Update(i.second);
}
}