diff options
| author | 2018-09-19 19:02:04 -0400 | |
|---|---|---|
| committer | 2018-09-19 19:02:06 -0400 | |
| commit | 3146502a12125a2511cfda1cd08924d71d378e10 (patch) | |
| tree | c3208927a64a1cb553c107a5675017a8adfdd7c2 /src/core | |
| parent | control_metadata: Move language name array definition to the cpp file (diff) | |
| download | yuzu-3146502a12125a2511cfda1cd08924d71d378e10.tar.gz yuzu-3146502a12125a2511cfda1cd08924d71d378e10.tar.xz yuzu-3146502a12125a2511cfda1cd08924d71d378e10.zip | |
control_metadata: Remove unnecessary else within GetLanguageEntry()
There's no need to indent the code here, given the if case contains a
return statement at the end of it.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/file_sys/control_metadata.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/file_sys/control_metadata.cpp b/src/core/file_sys/control_metadata.cpp index b47c95d11..f11b91399 100644 --- a/src/core/file_sys/control_metadata.cpp +++ b/src/core/file_sys/control_metadata.cpp | |||
| @@ -31,15 +31,15 @@ NACP::NACP(VirtualFile file) : raw(std::make_unique<RawNACP>()) { | |||
| 31 | const LanguageEntry& NACP::GetLanguageEntry(Language language) const { | 31 | const LanguageEntry& NACP::GetLanguageEntry(Language language) const { |
| 32 | if (language != Language::Default) { | 32 | if (language != Language::Default) { |
| 33 | return raw->language_entries.at(static_cast<u8>(language)); | 33 | return raw->language_entries.at(static_cast<u8>(language)); |
| 34 | } else { | ||
| 35 | for (const auto& language_entry : raw->language_entries) { | ||
| 36 | if (!language_entry.GetApplicationName().empty()) | ||
| 37 | return language_entry; | ||
| 38 | } | ||
| 39 | |||
| 40 | // Fallback to English | ||
| 41 | return GetLanguageEntry(Language::AmericanEnglish); | ||
| 42 | } | 34 | } |
| 35 | |||
| 36 | for (const auto& language_entry : raw->language_entries) { | ||
| 37 | if (!language_entry.GetApplicationName().empty()) | ||
| 38 | return language_entry; | ||
| 39 | } | ||
| 40 | |||
| 41 | // Fallback to English | ||
| 42 | return GetLanguageEntry(Language::AmericanEnglish); | ||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | std::string NACP::GetApplicationName(Language language) const { | 45 | std::string NACP::GetApplicationName(Language language) const { |