ams: std::optional -> util::optional

This commit is contained in:
Michael Scire
2021-07-08 02:37:26 -07:00
parent 9df13781c2
commit a7c14e03b9
59 changed files with 950 additions and 147 deletions

View File

@@ -54,7 +54,7 @@ namespace ams::fssrv::impl {
return m_list.size();
}
std::optional<fs::ProgramIndexMapInfo> Get(const ncm::ProgramId &program_id) const {
util::optional<fs::ProgramIndexMapInfo> Get(const ncm::ProgramId &program_id) const {
/* Acquire exclusive access to the map. */
std::scoped_lock lk(m_mutex);
@@ -134,9 +134,9 @@ namespace ams::fssrv::impl {
}
template<typename F>
std::optional<fs::ProgramIndexMapInfo> GetImpl(F f) const {
util::optional<fs::ProgramIndexMapInfo> GetImpl(F f) const {
/* Try to find an entry matching the predicate. */
std::optional<fs::ProgramIndexMapInfo> match = std::nullopt;
util::optional<fs::ProgramIndexMapInfo> match = util::nullopt;
for (const auto &entry : m_list) {
/* If the predicate matches, we want to return the relevant info. */

View File

@@ -92,7 +92,7 @@ namespace ams::fssrv::impl {
public:
bool IsDeepRetryEnabled() const;
bool IsAccessFailureDetectionObserved() const;
std::optional<std::shared_lock<os::ReadWriteLock>> AcquireCacheInvalidationReadLock();
util::optional<std::shared_lock<os::ReadWriteLock>> AcquireCacheInvalidationReadLock();
os::ReadWriteLock &GetReadWriteLockForCacheInvalidation();
public:
/* Command API. */

View File

@@ -44,7 +44,7 @@ namespace ams::fssrv::impl {
~StorageInterfaceAdapter();
private:
std::optional<std::shared_lock<os::ReadWriteLock>> AcquireCacheInvalidationReadLock();
util::optional<std::shared_lock<os::ReadWriteLock>> AcquireCacheInvalidationReadLock();
public:
/* Command API. */
Result Read(s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size);