mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-04-22 20:44:49 +00:00
lr: Eliminate unnecessary vars
This commit is contained in:
parent
c20d123f60
commit
e7d2f83ba5
4 changed files with 21 additions and 64 deletions
|
@ -20,7 +20,6 @@
|
|||
namespace sts::lr {
|
||||
|
||||
Result AddOnContentLocationResolverInterface::ResolveAddOnContentPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
ncm::StorageId storage_id = ncm::StorageId::None;
|
||||
|
||||
if (!this->registered_storages.Find(&storage_id, tid)) {
|
||||
|
@ -35,8 +34,7 @@ namespace sts::lr {
|
|||
|
||||
std::shared_ptr<ncm::IContentStorage> content_storage;
|
||||
R_TRY(ncm::impl::OpenContentStorage(&content_storage, storage_id));
|
||||
R_ASSERT(content_storage->GetPath(&path, data_content_id));
|
||||
*out.pointer = path;
|
||||
R_ASSERT(content_storage->GetPath(out.pointer, data_content_id));
|
||||
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
|
|
@ -28,10 +28,7 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveProgramPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (this->program_redirector.FindRedirection(&path, tid)) {
|
||||
*out.pointer = path;
|
||||
if (this->program_redirector.FindRedirection(out.pointer, tid)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
@ -43,8 +40,7 @@ namespace sts::lr {
|
|||
}
|
||||
} R_END_TRY_CATCH;
|
||||
|
||||
R_ASSERT(this->content_storage->GetPath(&path, program_content_id));
|
||||
*out.pointer = path;
|
||||
R_ASSERT(this->content_storage->GetPath(out.pointer, program_content_id));
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
@ -54,10 +50,7 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveApplicationControlPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (this->app_control_redirector.FindRedirection(&path, tid)) {
|
||||
*out.pointer = path;
|
||||
if (this->app_control_redirector.FindRedirection(out.pointer, tid)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
@ -65,10 +58,7 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveApplicationHtmlDocumentPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (this->html_docs_redirector.FindRedirection(&path, tid)) {
|
||||
*out.pointer = path;
|
||||
if (this->html_docs_redirector.FindRedirection(out.pointer, tid)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
@ -76,12 +66,10 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveDataPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
ncm::ContentId data_content_id;
|
||||
|
||||
R_TRY(this->content_meta_database->GetLatestData(&data_content_id, tid));
|
||||
R_ASSERT(this->content_storage->GetPath(&path, data_content_id));
|
||||
*out.pointer = path;
|
||||
R_ASSERT(this->content_storage->GetPath(out.pointer, data_content_id));
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
@ -96,10 +84,7 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveApplicationLegalInformationPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (this->legal_info_redirector.FindRedirection(&path, tid)) {
|
||||
*out.pointer = path;
|
||||
if (this->legal_info_redirector.FindRedirection(out.pointer, tid)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
@ -163,20 +148,16 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveProgramPathForDebug(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (this->debug_program_redirector.FindRedirection(&path, tid)) {
|
||||
*out.pointer = path;
|
||||
if (this->debug_program_redirector.FindRedirection(out.pointer, tid)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
R_TRY_CATCH(this->ResolveProgramPath(&path, tid)) {
|
||||
R_TRY_CATCH(this->ResolveProgramPath(out.pointer, tid)) {
|
||||
R_CATCH(ResultLrProgramNotFound) {
|
||||
return ResultLrDebugProgramNotFound;
|
||||
}
|
||||
} R_END_TRY_CATCH;
|
||||
|
||||
*out.pointer = path;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,10 +28,7 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result RedirectOnlyLocationResolverInterface::ResolveProgramPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (this->program_redirector.FindRedirection(&path, tid)) {
|
||||
*out.pointer = path;
|
||||
if (this->program_redirector.FindRedirection(out.pointer, tid)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
@ -44,10 +41,7 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result RedirectOnlyLocationResolverInterface::ResolveApplicationControlPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (this->app_control_redirector.FindRedirection(&path, tid)) {
|
||||
*out.pointer = path;
|
||||
if (this->app_control_redirector.FindRedirection(out.pointer, tid)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
@ -55,10 +49,7 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result RedirectOnlyLocationResolverInterface::ResolveApplicationHtmlDocumentPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (this->html_docs_redirector.FindRedirection(&path, tid)) {
|
||||
*out.pointer = path;
|
||||
if (this->html_docs_redirector.FindRedirection(out.pointer, tid)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
@ -80,10 +71,7 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result RedirectOnlyLocationResolverInterface::ResolveApplicationLegalInformationPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (this->legal_info_redirector.FindRedirection(&path, tid)) {
|
||||
*out.pointer = path;
|
||||
if (this->legal_info_redirector.FindRedirection(out.pointer, tid)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
@ -139,20 +127,16 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result RedirectOnlyLocationResolverInterface::ResolveProgramPathForDebug(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (this->debug_program_redirector.FindRedirection(&path, tid)) {
|
||||
*out.pointer = path;
|
||||
if (this->debug_program_redirector.FindRedirection(out.pointer, tid)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
R_TRY_CATCH(this->ResolveProgramPath(&path, tid)) {
|
||||
R_TRY_CATCH(this->ResolveProgramPath(out.pointer, tid)) {
|
||||
R_CATCH(ResultLrProgramNotFound) {
|
||||
return ResultLrDebugProgramNotFound;
|
||||
}
|
||||
} R_END_TRY_CATCH;
|
||||
|
||||
*out.pointer = path;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,20 +25,17 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result RegisteredLocationResolverInterface::ResolveProgramPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (!this->program_redirector.FindRedirection(&path, tid)) {
|
||||
if (!this->registered_program_locations.Find(&path, tid)) {
|
||||
if (!this->program_redirector.FindRedirection(out.pointer, tid)) {
|
||||
if (!this->registered_program_locations.Find(out.pointer, tid)) {
|
||||
return ResultLrProgramNotFound;
|
||||
}
|
||||
}
|
||||
|
||||
*out.pointer = path;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result RegisteredLocationResolverInterface::RegisterProgramPath(InPointer<const Path> path, ncm::TitleId tid) {
|
||||
Path tmp_path = *path.pointer;
|
||||
const Path& tmp_path = *path.pointer;
|
||||
|
||||
if (!this->registered_program_locations.Register(tid, tmp_path)) {
|
||||
this->registered_program_locations.Clear();
|
||||
|
@ -60,20 +57,17 @@ namespace sts::lr {
|
|||
}
|
||||
|
||||
Result RegisteredLocationResolverInterface::ResolveHtmlDocumentPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
Path path;
|
||||
|
||||
if (!this->html_docs_redirector.FindRedirection(&path, tid)) {
|
||||
if (!this->registered_html_docs_locations.Find(&path, tid)) {
|
||||
if (!this->html_docs_redirector.FindRedirection(out.pointer, tid)) {
|
||||
if (!this->registered_html_docs_locations.Find(out.pointer, tid)) {
|
||||
return ResultLrProgramNotFound;
|
||||
}
|
||||
}
|
||||
|
||||
*out.pointer = path;
|
||||
return ResultLrHtmlDocumentNotFound;
|
||||
}
|
||||
|
||||
Result RegisteredLocationResolverInterface::RegisterHtmlDocumentPath(InPointer<const Path> path, ncm::TitleId tid) {
|
||||
Path tmp_path = *path.pointer;
|
||||
const Path& tmp_path = *path.pointer;
|
||||
|
||||
if (!this->registered_html_docs_locations.Register(tid, tmp_path)) {
|
||||
this->registered_html_docs_locations.Clear();
|
||||
|
|
Loading…
Add table
Reference in a new issue