Add basic http router benchmark
This commit is contained in:
+1
-7
@@ -134,7 +134,7 @@ private:
|
||||
inline std::pair<std::string_view, bool> getUrlSegment(int urlSegment) {
|
||||
if (urlSegment > urlSegmentTop) {
|
||||
/* Signal as STOP when we have no more URL or stack space */
|
||||
if (!currentUrl.length() || urlSegment > 99) {
|
||||
if (!currentUrl.length() || urlSegment > MAX_URL_SEGMENTS - 1) {
|
||||
return {{}, true};
|
||||
}
|
||||
|
||||
@@ -292,12 +292,6 @@ public:
|
||||
/* Alloate this handler */
|
||||
handlers.emplace_back(std::move(handler));
|
||||
|
||||
/* Assume can find this handler again */
|
||||
if (((handlers.size() - 1) | priority) != findHandler(methods[0], pattern, priority)) {
|
||||
std::cerr << "Error: Internal routing error" << std::endl;
|
||||
std::abort();
|
||||
}
|
||||
|
||||
/* ANY method must be last, GET must be first */
|
||||
std::sort(root.children.begin(), root.children.end(), [](const auto &a, const auto &b) {
|
||||
/* Assuming the list of methods is unique, non-repeating */
|
||||
|
||||
Reference in New Issue
Block a user