1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Only fallback if only one element differs

This commit is contained in:
Marijn van der Werf
2016-10-22 02:40:35 +02:00
parent 6f2b20d3c0
commit 157d535f67
3 changed files with 1 additions and 24 deletions

View File

@@ -54,17 +54,6 @@ bool GeneralSupportHeightCall::FindMostCommonSupportCall(SupportCall calls[4], S
return false;
}
if (map.size() == 3) {
for (auto &&item : map) {
if (item.second == 2) {
(*out) = item.first;
return true;
}
}
return false;
}
return false;
}

View File

@@ -137,16 +137,5 @@ bool SegmentSupportHeightCall::FindMostCommonSupportCall(std::vector<SegmentSupp
return false;
}
if (map.size() == 3) {
for (auto &&item : map) {
if (item.second == 2) {
(*out) = item.first;
return true;
}
}
return false;
}
return false;
}

View File

@@ -416,8 +416,7 @@ static void TestGeneralSupportHeightCall() {
SupportCall groupD[4] = {callB, callC, callB, callA};
success = GeneralSupportHeightCall::FindMostCommonSupportCall(groupD, &out);
assert(success);
assert(out == callB);
assert(!success);
SupportCall groupE[4] = {callD, callC, callB, callA};
success = GeneralSupportHeightCall::FindMostCommonSupportCall(groupE, &out);