diff options
author | Lioncash <mathew1800@gmail.com> | 2018-09-25 18:06:35 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-09-25 20:06:21 -0400 |
commit | f646ca874d8589f4be4a7e6bcce69301e60b24f3 (patch) | |
tree | 37a61ccfed8e5ae65803022133989b96dc92c9bb /src/yuzu/main.cpp | |
parent | cbb146069a7b20d5687d5d163fd1400af3151485 (diff) |
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.
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 1b125cbd39..d74489935a 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 out += 1 + CalculateRomFSEntrySize(subdir, full); } - return out + full ? dir->GetFiles().size() : 0; + return out + (full ? dir->GetFiles().size() : 0); } static bool RomFSRawCopy(QProgressDialog& dialog, const FileSys::VirtualDir& src, |