mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-01-10 08:29:29 +01:00
23 lines
554 B
C++
23 lines
554 B
C++
#include "common.h"
|
|
#include <algorithm>
|
|
#include "SaveList.h"
|
|
|
|
const SaveListEntry* SaveList::FindEntry(u32 gameCode)
|
|
{
|
|
if (_count != 0)
|
|
{
|
|
const auto gameEntry = std::lower_bound(_entries.get(), _entries.get() + _count, gameCode,
|
|
[] (const SaveListEntry& entry, u32 value)
|
|
{
|
|
return entry.GetGameCode() < value;
|
|
});
|
|
|
|
if (gameEntry != _entries.get() + _count && gameEntry->GetGameCode() == gameCode)
|
|
{
|
|
return gameEntry;
|
|
}
|
|
}
|
|
|
|
return nullptr;
|
|
}
|