Saving a few CPU cycles

This silly optimization in fact helps to avoid a somewhat more serious
waste of CPU cycles that would otherwise result in the next commit.
This commit is contained in:
Veloman Yunkan 2023-02-08 21:22:39 +01:00
parent a7fe4193e3
commit 97f0314fe6
2 changed files with 3 additions and 1 deletions

View File

@ -415,6 +415,7 @@ InternalServer::InternalServer(Library* library,
m_addr(addr),
m_port(port),
m_root(normalizeRootUrl(root)),
m_rootWithSeparator(m_root + "/"),
m_nbThreads(nbThreads),
m_multizimSearchLimit(multizimSearchLimit),
m_verbose(verbose),
@ -519,7 +520,7 @@ MHD_Result InternalServer::handlerCallback(struct MHD_Connection* connection,
printf("full_url : %s\n", fullUrl);
}
const auto url = fullURL2LocalURL(fullUrl, m_root + "/");
const auto url = fullURL2LocalURL(fullUrl, m_rootWithSeparator);
RequestContext request(connection, m_root, url, method, version);
if (m_verbose.load() ) {

View File

@ -164,6 +164,7 @@ class InternalServer {
std::string m_addr;
int m_port;
std::string m_root;
std::string m_rootWithSeparator;
int m_nbThreads;
unsigned int m_multizimSearchLimit;
std::atomic_bool m_verbose;