mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-10-05 15:49:01 +00:00
Simplify std::find_if
with Common::Contains
This commit is contained in:
parent
110d32729e
commit
d92c68e1de
5 changed files with 25 additions and 49 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue