mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-30 07:34:37 +01: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:
committed by
Peter Nelson
parent
b449839538
commit
3d8d0e0d26
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user