Преглед изворни кода

file_sys/card_image: Get rid of a magic number

We can just use the size of the array to dehardcode it.
Lioncash пре 7 година
родитељ
комит
825ffd7b1f
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/core/file_sys/card_image.cpp

+ 1 - 1
src/core/file_sys/card_image.cpp

@@ -27,7 +27,7 @@ constexpr std::array partition_names{
 
 XCI::XCI(VirtualFile file_)
     : file(std::move(file_)), program_nca_status{Loader::ResultStatus::ErrorXCIMissingProgramNCA},
-      partitions(0x4) {
+      partitions(partition_names.size()) {
     if (file->ReadObject(&header) != sizeof(GamecardHeader)) {
         status = Loader::ResultStatus::ErrorBadXCIHeader;
         return;