完善key-value解析代码

This commit is contained in:
ziyue 2021-09-03 18:11:20 +08:00
parent 246f446142
commit c2bf2928d0

View File

@ -148,7 +148,10 @@ StrCaseMap Parser::parseArgs(const string &str, const char *pair_delim, const ch
auto val = trim(FindField(key_val.data(), key_delim, NULL)); auto val = trim(FindField(key_val.data(), key_delim, NULL));
ret.emplace_force(key, val); ret.emplace_force(key, val);
} else { } else {
ret.emplace_force(key_val, ""); trim(key_val);
if (!key_val.empty()) {
ret.emplace_force(key_val, "");
}
} }
} }
return ret; return ret;