mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-23 04:04:09 +01:00
Codefix: std::string_view does not accept nullptr
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user