summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-12-06 04:37:14 +0100
committerGitHub <noreply@github.com>2018-12-06 04:37:14 +0100
commit4c106b43a9cb41f22935b4405373ca05a15dc7a9 (patch)
tree7735c506ed6ce4a7f6d93414063eeb2f5cb6938b
parentMerge pull request #1866 from lioncash/cache (diff)
parentng_word: Deduplicate use of a constant value (diff)
downloadyuzu-4c106b43a9cb41f22935b4405373ca05a15dc7a9.tar
yuzu-4c106b43a9cb41f22935b4405373ca05a15dc7a9.tar.gz
yuzu-4c106b43a9cb41f22935b4405373ca05a15dc7a9.tar.bz2
yuzu-4c106b43a9cb41f22935b4405373ca05a15dc7a9.tar.lz
yuzu-4c106b43a9cb41f22935b4405373ca05a15dc7a9.tar.xz
yuzu-4c106b43a9cb41f22935b4405373ca05a15dc7a9.tar.zst
yuzu-4c106b43a9cb41f22935b4405373ca05a15dc7a9.zip
Diffstat (limited to '')
-rw-r--r--src/core/file_sys/system_archive/ng_word.cpp2
-rw-r--r--src/core/file_sys/system_archive/system_archive.cpp5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/core/file_sys/system_archive/ng_word.cpp b/src/core/file_sys/system_archive/ng_word.cpp
index d0acdbd49..a24f1e496 100644
--- a/src/core/file_sys/system_archive/ng_word.cpp
+++ b/src/core/file_sys/system_archive/ng_word.cpp
@@ -26,7 +26,7 @@ constexpr std::array<u8, 30> WORD_TXT{
VirtualDir NgWord1() {
std::vector<VirtualFile> files(NgWord1Data::NUMBER_WORD_TXT_FILES);
- for (std::size_t i = 0; i < NgWord1Data::NUMBER_WORD_TXT_FILES; ++i) {
+ for (std::size_t i = 0; i < files.size(); ++i) {
files[i] = std::make_shared<ArrayVfsFile<NgWord1Data::WORD_TXT.size()>>(
NgWord1Data::WORD_TXT, fmt::format("{}.txt", i));
}
diff --git a/src/core/file_sys/system_archive/system_archive.cpp b/src/core/file_sys/system_archive/system_archive.cpp
index c9c40a07d..d3883267c 100644
--- a/src/core/file_sys/system_archive/system_archive.cpp
+++ b/src/core/file_sys/system_archive/system_archive.cpp
@@ -2,7 +2,6 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include <functional>
#include "common/logging/log.h"
#include "core/file_sys/romfs.h"
#include "core/file_sys/system_archive/ng_word.h"
@@ -13,7 +12,7 @@ namespace FileSys::SystemArchive {
constexpr u64 SYSTEM_ARCHIVE_BASE_TITLE_ID = 0x0100000000000800;
constexpr std::size_t SYSTEM_ARCHIVE_COUNT = 0x28;
-using SystemArchiveSupplier = std::function<VirtualDir()>;
+using SystemArchiveSupplier = VirtualDir (*)();
struct SystemArchiveDescriptor {
u64 title_id;
@@ -21,7 +20,7 @@ struct SystemArchiveDescriptor {
SystemArchiveSupplier supplier;
};
-const std::array<SystemArchiveDescriptor, SYSTEM_ARCHIVE_COUNT> SYSTEM_ARCHIVES = {{
+constexpr std::array<SystemArchiveDescriptor, SYSTEM_ARCHIVE_COUNT> SYSTEM_ARCHIVES{{
{0x0100000000000800, "CertStore", nullptr},
{0x0100000000000801, "ErrorMessage", nullptr},
{0x0100000000000802, "MiiModel", nullptr},