rawinput: stop iterating devices if one was found (#457)

## Link to GitHub Issue, if one exists
n/a

## Description of change
This would save a handful of instructions at best but it was bothering
me

## Testing
Tested with two controllers + naive with ddr
This commit is contained in:
bicarus-dev
2025-12-17 05:40:27 -08:00
committed by GitHub
parent e618a05b08
commit 71b144918c
+5 -2
View File
@@ -1498,7 +1498,7 @@ LRESULT CALLBACK rawinput::RawInputManager::input_wnd_proc(
} }
// get input time // get input time
double input_time = get_performance_seconds(); const auto input_time = get_performance_seconds();
// lock device // lock device
device.mutex->lock(); device.mutex->lock();
@@ -1826,6 +1826,9 @@ LRESULT CALLBACK rawinput::RawInputManager::input_wnd_proc(
// free device // free device
device.mutex->unlock(); device.mutex->unlock();
// don't iterate through the other devices
break;
} }
// update controller state ring buffers (DDR/MDXF) // update controller state ring buffers (DDR/MDXF)
@@ -1924,7 +1927,7 @@ void CALLBACK rawinput::RawInputManager::input_midi_proc(HMIDIIN hMidiIn, UINT w
} }
// get input time // get input time
auto input_time = get_performance_seconds(); const auto input_time = get_performance_seconds();
// lock device // lock device
std::lock_guard<std::mutex> lock(*device.mutex); std::lock_guard<std::mutex> lock(*device.mutex);