1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 20:49:11 +00:00

Codechange: Use std::variant to store string parameter data.

This avoids storing two separate values and makes the test for which type is held clearer.

This replaces use of unique_ptr for conditionally storing a string, and is also used in place of StringParameterBackup.
This commit is contained in:
2024-07-29 17:58:32 +01:00
committed by Peter Nelson
parent b449839538
commit 3d8d0e0d26
10 changed files with 39 additions and 92 deletions

View File

@@ -18,7 +18,7 @@ TEST_CASE("HaveDParamChanged")
SetDParam(0, 0);
SetDParamStr(1, "some string");
std::vector<StringParameterBackup> backup;
std::vector<StringParameterData> backup;
CopyOutDParam(backup, 2);
CHECK(HaveDParamChanged(backup) == false);