mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[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:
@@ -60,7 +60,7 @@ std::string_view MimeTypeFromPath(std::string_view path) {
|
||||
if (dot_pos > 0 && dot_pos != std::string_view::npos) {
|
||||
auto type = mimeTypes.find(wpi::substr(path, dot_pos + 1));
|
||||
if (type != mimeTypes.end()) {
|
||||
return type->getValue();
|
||||
return type->second;
|
||||
}
|
||||
}
|
||||
return defaultType;
|
||||
|
||||
@@ -375,8 +375,8 @@ class HttpRequest {
|
||||
return elem.first;
|
||||
}
|
||||
template <typename T>
|
||||
static std::string_view GetFirst(const StringMapEntry<T>& elem) {
|
||||
return elem.getKey();
|
||||
static std::string_view GetFirst(const std::pair<std::string, T>& elem) {
|
||||
return elem.first;
|
||||
}
|
||||
template <typename T>
|
||||
static std::string_view GetSecond(const T& elem) {
|
||||
|
||||
Reference in New Issue
Block a user