introduce string_view
This commit is contained in:
+2
-4
@@ -8,13 +8,12 @@
|
||||
|
||||
namespace webcc {
|
||||
|
||||
bool Router::Route(const std::string& url, ViewPtr view,
|
||||
const Strings& methods) {
|
||||
bool Router::Route(string_view url, ViewPtr view, const Strings& methods) {
|
||||
assert(view);
|
||||
|
||||
// TODO: More error check
|
||||
|
||||
routes_.push_back({ url, {}, view, methods });
|
||||
routes_.push_back({ ToString(url), {}, view, methods });
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -26,7 +25,6 @@ bool Router::Route(const UrlRegex& regex_url, ViewPtr view,
|
||||
// TODO: More error check
|
||||
|
||||
try {
|
||||
|
||||
routes_.push_back({ "", regex_url(), view, methods });
|
||||
|
||||
} catch (const std::regex_error& e) {
|
||||
|
||||
Reference in New Issue
Block a user