完善key-value解析代码

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

View File

@ -148,9 +148,12 @@ 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 {
trim(key_val);
if (!key_val.empty()) {
ret.emplace_force(key_val, ""); ret.emplace_force(key_val, "");
} }
} }
}
return ret; return ret;
} }