From 640f907fb2059c40e9d10bc19860d5e157410f04 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 24 Oct 2018 15:05:33 +0200 Subject: [PATCH] Avoid recopy of books --- src/server/kiwix-serve.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index d2fd3f2..1345c30 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -1085,7 +1085,7 @@ int main(int argc, char** argv) globalSearcher->setProtocolPrefix(rootLocation + "/"); globalSearcher->setSearchProtocolPrefix(rootLocation + "/" + "search?"); for (auto& bookId: booksIds) { - auto currentBook = library.getBookById(bookId); + auto& currentBook = library.getBookById(bookId); auto zimPath = currentBook.getPath(); auto indexPath = currentBook.getIndexPath(); @@ -1129,7 +1129,7 @@ int main(int argc, char** argv) = "" "
"; for (auto& bookId: booksIds) { - auto currentBook = library.getBookById(bookId); + auto& currentBook = library.getBookById(bookId); if (!currentBook.getPath().empty() && readers.find(currentBook.getHumanReadableIdFromPath())