Don't copy params

This commit is contained in:
flamingcow
2019-05-09 19:49:05 -07:00
parent 05382c76a5
commit 19c390aa54
2 changed files with 4 additions and 4 deletions

View File

@@ -40,10 +40,10 @@ void Request::SetBody(const std::string_view& body) {
body_ = body;
}
const std::string& Request::GetParam(const std::string& key) {
const std::string_view& Request::GetParam(const std::string& key) {
auto iter = params_.find(key);
if (iter == params_.end()) {
static const std::string none;
static const std::string_view none;
return none;
}
return iter->second;