mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-03 22:43:38 +01:00
de7e9557dc
Previously, when performing find() operations or indexing operations on the section map, it would need to operate on a std::string key. This means cases like: map.find(some_string_view) aren't usable, which kind of sucks, especially given for most cases, we use regular string literals to perform operations in calling code. However, since C++14, it's possible to use heterogenous lookup to avoid needing to construct exact key types. In otherwords, we can perform the above or use string literals without constructing a std::string instance around them implicitly. We simply need to specify a member type within our comparison struct named is_transparent, to allow std::map to perform automatic type deduction. We also slightly alter the algorithm to an equivalent compatible with std::string_view (which need not be null-terminated), as strcasecmp requires null-terminated strings. While we're at it, we can also provide a helper function to the struct for comparing string equality rather than only less than. This allows removing other usages of strcasecmp in other functions, allowing for the transition of them to std::string_view. |
||
---|---|---|
.. | ||
AudioCommon | ||
Common | ||
Core | ||
DiscIO | ||
DolphinNoGUI | ||
DolphinQt | ||
InputCommon | ||
MacUpdater | ||
UICommon | ||
UpdaterCommon | ||
VideoBackends | ||
VideoCommon | ||
WinUpdater | ||
CMakeLists.txt |