mirror of
https://git.suyu.dev/suyu/suyu
synced 2026-04-22 23:02:53 +00:00
Using reserve() for optimization inserts, marked unused pair items and minor code refactor
This commit is contained in:
committed by
chaphidoesstuff
parent
9490b5264e
commit
e886f27816
@@ -571,7 +571,7 @@ SDLDriver::~SDLDriver() {
|
||||
std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const {
|
||||
std::vector<Common::ParamPackage> devices;
|
||||
std::unordered_map<int, std::shared_ptr<SDLJoystick>> joycon_pairs;
|
||||
for (const auto& [key, value] : joystick_map) {
|
||||
for (const auto& [_, value] : joystick_map) {
|
||||
for (const auto& joystick : value) {
|
||||
if (!joystick->GetSDLJoystick()) {
|
||||
continue;
|
||||
@@ -591,7 +591,7 @@ std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const {
|
||||
}
|
||||
|
||||
// Add dual controllers
|
||||
for (const auto& [key, value] : joystick_map) {
|
||||
for (const auto& [_, value] : joystick_map) {
|
||||
for (const auto& joystick : value) {
|
||||
if (joystick->IsJoyconRight()) {
|
||||
if (!joycon_pairs.contains(joystick->GetPort())) {
|
||||
|
||||
Reference in New Issue
Block a user