mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-27 08:10:13 -06:00
Simplify std::find_if
with Common::Contains
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Contains.h"
|
||||
#include "Common/Event.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/IOFile.h"
|
||||
@ -261,9 +262,7 @@ static int GetEmptySlot(const std::vector<SlotWithTimestamp>& used_slots)
|
||||
{
|
||||
for (int i = 1; i <= (int)NUM_STATES; i++)
|
||||
{
|
||||
const auto it = std::find_if(used_slots.begin(), used_slots.end(),
|
||||
[i](const SlotWithTimestamp& slot) { return slot.slot == i; });
|
||||
if (it == used_slots.end())
|
||||
if (!Common::Contains(used_slots, i, &SlotWithTimestamp::slot))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user