mirror of https://github.com/OpenTTD/OpenTTD
Codefix: std::string_view does not accept nullptr
parent
e200e9b401
commit
023bf38338
|
@ -273,7 +273,7 @@ static void ExtractStringParams(const StringData &data, StringParamsList ¶ms
|
|||
if (*it == nullptr) {
|
||||
/* Skip empty param unless a non empty param exist after it. */
|
||||
if (std::all_of(it, pcs.consuming_commands.end(), [](auto cs) { return cs == nullptr; })) break;
|
||||
param.emplace_back(StringParam::UNUSED, 1, nullptr);
|
||||
param.emplace_back(StringParam::UNUSED, 1);
|
||||
continue;
|
||||
}
|
||||
const CmdStruct *cs = *it;
|
||||
|
|
|
@ -24,7 +24,7 @@ struct StringParam {
|
|||
uint8_t consumes;
|
||||
std::string_view cmd;
|
||||
|
||||
StringParam(ParamType type, uint8_t consumes, std::string_view cmd) : type(type), consumes(consumes), cmd(cmd) {}
|
||||
StringParam(ParamType type, uint8_t consumes, std::string_view cmd = {}) : type(type), consumes(consumes), cmd(cmd) {}
|
||||
};
|
||||
using StringParams = std::vector<StringParam>;
|
||||
using StringParamsList = std::vector<StringParams>;
|
||||
|
|
Loading…
Reference in New Issue