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:
committed by
Peter Nelson
parent
59b18560d4
commit
9eb28def57
@@ -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 ¶m;
|
||||
return param;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user