From f646ca874d8589f4be4a7e6bcce69301e60b24f3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 25 Sep 2018 18:06:35 -0400 Subject: 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. --- src/yuzu/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 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, -- cgit v1.2.3