1
0
Fork 0

Codefix: std::string_view does not accept nullptr

pull/13939/head
Rubidium 2025-03-31 20:22:43 +02:00 committed by rubidium42
parent e200e9b401
commit 023bf38338
2 changed files with 2 additions and 2 deletions

View File

@ -273,7 +273,7 @@ static void ExtractStringParams(const StringData &data, StringParamsList &params
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;

View File

@ -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>;