Skip to content

Commit

Permalink
fixup! Retrieve SuggestionSearcher from LRU Cache
Browse files Browse the repository at this point in the history
  • Loading branch information
maneeshpm committed Jan 9, 2022
1 parent 00af73c commit c5ed9c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/internalServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,11 @@ std::unique_ptr<Response> InternalServer::handle_suggest(const RequestContext& r
printf("** running handle_suggest\n");
}

std::string bookName;
std::string bookName, bookId;
std::shared_ptr<zim::Archive> archive;
try {
bookName = request.get_argument("content");
const std::string bookId = mp_nameMapper->getIdForName(bookName);
bookId = mp_nameMapper->getIdForName(bookName);
archive = mp_library->getArchiveById(bookId);
} catch (const std::out_of_range&) {
// error handled by the archive == nullptr check below
Expand Down

0 comments on commit c5ed9c5

Please sign in to comment.