summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2018-09-25 18:06:35 -0400
committerGravatar Lioncash2018-09-25 20:06:21 -0400
commitf646ca874d8589f4be4a7e6bcce69301e60b24f3 (patch)
tree37a61ccfed8e5ae65803022133989b96dc92c9bb
parentyuzu/main: Move functions stored into static std::function instances out of O... (diff)
downloadyuzu-f646ca874d8589f4be4a7e6bcce69301e60b24f3.tar.gz
yuzu-f646ca874d8589f4be4a7e6bcce69301e60b24f3.tar.xz
yuzu-f646ca874d8589f4be4a7e6bcce69301e60b24f3.zip
yuzu/main: Resolve precedence bug within CalculateRomFSEntrySize()
Ternary operators have a lower precedence than arithmetic operators, so what was actually occurring here is "return (out + full) ? x : y" which most definitely isn't intended, given we calculate out recursively above. We were essentially doing a lot of work for nothing.
-rw-r--r--src/yuzu/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 1b125cbd3..d74489935 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -763,7 +763,7 @@ static std::size_t CalculateRomFSEntrySize(const FileSys::VirtualDir& dir, bool
763 out += 1 + CalculateRomFSEntrySize(subdir, full); 763 out += 1 + CalculateRomFSEntrySize(subdir, full);
764 } 764 }
765 765
766 return out + full ? dir->GetFiles().size() : 0; 766 return out + (full ? dir->GetFiles().size() : 0);
767} 767}
768 768
769static bool RomFSRawCopy(QProgressDialog& dialog, const FileSys::VirtualDir& src, 769static bool RomFSRawCopy(QProgressDialog& dialog, const FileSys::VirtualDir& src,