diff --git a/include/crow/query_string.h b/include/crow/query_string.h index 274044136..78ccc677f 100644 --- a/include/crow/query_string.h +++ b/include/crow/query_string.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -220,8 +221,6 @@ inline boost::optional> qs_dict_name2kv(cons skip_to_brace_open++; skip_to_brace_close = strcspn(qs_kv[i], "]"); - std::cout << skip_to_brace_open << " FUFUU " << skip_to_brace_close << std::endl; - if ( skip_to_brace_open <= skip_to_brace_close && skip_to_brace_open > 0 && skip_to_brace_close > 0 && @@ -381,16 +380,15 @@ namespace crow return ret; } - std::vector> get_dict (const std::string& name) const + std::unordered_map get_dict (const std::string& name) const { - std::vector> ret; - std::string plus = name; + std::unordered_map ret; int count = 0; while(1) { - if (auto element = qs_dict_name2kv(plus.c_str(), key_value_pairs_.data(), key_value_pairs_.size(), count++)) - ret.push_back(*element); + if (auto element = qs_dict_name2kv(name.c_str(), key_value_pairs_.data(), key_value_pairs_.size(), count++)) + ret.insert(*element); else break; }