mirror of https://github.com/kiwix/libkiwix.git
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:
parent
a7fe4193e3
commit
97f0314fe6
|
@ -415,6 +415,7 @@ InternalServer::InternalServer(Library* library,
|
||||||
m_addr(addr),
|
m_addr(addr),
|
||||||
m_port(port),
|
m_port(port),
|
||||||
m_root(normalizeRootUrl(root)),
|
m_root(normalizeRootUrl(root)),
|
||||||
|
m_rootWithSeparator(m_root + "/"),
|
||||||
m_nbThreads(nbThreads),
|
m_nbThreads(nbThreads),
|
||||||
m_multizimSearchLimit(multizimSearchLimit),
|
m_multizimSearchLimit(multizimSearchLimit),
|
||||||
m_verbose(verbose),
|
m_verbose(verbose),
|
||||||
|
@ -519,7 +520,7 @@ MHD_Result InternalServer::handlerCallback(struct MHD_Connection* connection,
|
||||||
printf("full_url : %s\n", fullUrl);
|
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);
|
RequestContext request(connection, m_root, url, method, version);
|
||||||
|
|
||||||
if (m_verbose.load() ) {
|
if (m_verbose.load() ) {
|
||||||
|
|
|
@ -164,6 +164,7 @@ class InternalServer {
|
||||||
std::string m_addr;
|
std::string m_addr;
|
||||||
int m_port;
|
int m_port;
|
||||||
std::string m_root;
|
std::string m_root;
|
||||||
|
std::string m_rootWithSeparator;
|
||||||
int m_nbThreads;
|
int m_nbThreads;
|
||||||
unsigned int m_multizimSearchLimit;
|
unsigned int m_multizimSearchLimit;
|
||||||
std::atomic_bool m_verbose;
|
std::atomic_bool m_verbose;
|
||||||
|
|
Loading…
Reference in New Issue