1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 17:32:45 +01:00

Codechange: Return reference from GetNextParameterPointer.

GetNextParameterPointer can no longer return nullptr, and the callers do not check for nullptr, so return a reference instead.
This commit is contained in:
Peter Nelson
2024-07-30 12:17:27 +01:00
committed by Peter Nelson
parent 59b18560d4
commit 9eb28def57
2 changed files with 8 additions and 8 deletions

View File

@@ -76,9 +76,9 @@ void StringParameters::PrepareForNextRun()
* Get the next parameter from our parameters.
* This updates the offset, so the next time this is called the next parameter
* will be read.
* @return The pointer to the next parameter.
* @return The next parameter.
*/
StringParameter *StringParameters::GetNextParameterPointer()
const StringParameter &StringParameters::GetNextParameterReference()
{
assert(this->next_type == 0 || (SCC_CONTROL_START <= this->next_type && this->next_type <= SCC_CONTROL_END));
if (this->offset >= this->parameters.size()) {
@@ -92,7 +92,7 @@ StringParameter *StringParameters::GetNextParameterPointer()
}
param.type = this->next_type;
this->next_type = 0;
return &param;
return param;
}