From 3f6e6b19dbf3aa4e2745823869cedaee6fbba99f Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 16 Jul 2022 11:05:43 +0200 Subject: [PATCH] Restore optional optimization of GetSizeForThemeRoom Looks like this improves performance by about 8% --- Source/levels/gendung.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/levels/gendung.cpp b/Source/levels/gendung.cpp index e7f5c53a4..9e17ecd1c 100644 --- a/Source/levels/gendung.cpp +++ b/Source/levels/gendung.cpp @@ -116,6 +116,8 @@ std::optional GetSizeForThemeRoom(int floor, Point origin, int minSize, in yArray[x]++; } + if (yArray[x] < minSize) + break; } int xArray[20] = {}; @@ -129,6 +131,8 @@ std::optional GetSizeForThemeRoom(int floor, Point origin, int minSize, in xArray[y]++; } + if (xArray[y] < minSize) + break; } int xSmallest = xArray[0];