2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00
yuzu/src/core/hle/service/apm
Lioncash b77430df70 apm/controller: Make SetPerformanceConfiguration() use an array of pairs over a map
While a map is an OK way to do lookups (and usually recommended in most
cases), this is a map that lives for the entire duration of the program
and only deallocates its contents when the program terminates.

Given the total size of the map is quite small, we can simply use a
std::array of pairs and utilize std::find_if to perform the same
behavior without loss of performance.

This eliminates a static constructor and places the data into the
read-only segment.

While we're at it, we can also handle malformed inputs instead of
directly dereferencing the resulting iterator.
2019-10-17 16:13:14 -04:00
..
apm.cpp
apm.h
controller.cpp apm/controller: Make SetPerformanceConfiguration() use an array of pairs over a map 2019-10-17 16:13:14 -04:00
controller.h apm/controller: Make GetCurrentPerformanceMode() a const member function 2019-10-17 15:58:25 -04:00
interface.cpp apm: Implement SetCpuBoostMode 2019-06-28 22:46:00 -04:00
interface.h apm: Implement SetCpuBoostMode 2019-06-28 22:46:00 -04:00