+ small simplification of the code

This commit is contained in:
kelson42 2014-08-29 02:46:25 -06:00
parent ce0fe47daf
commit 965968e38f

View File

@ -239,7 +239,6 @@ static int accessHandlerCallback(void *cls,
if (reader == NULL) {
humanReadableBookId="";
}
pthread_mutex_unlock(&mapLock);
/* Get suggestions */
@ -330,10 +329,9 @@ static int accessHandlerCallback(void *cls,
/* Display a random article */
else if (!strcmp(url, "/random")) {
cacheEnabled = false;
std::string randomUrl;
if (reader != NULL) {
pthread_mutex_lock(&readerLock);
randomUrl = reader->getRandomPageUrl();
std::string randomUrl = reader->getRandomPageUrl();
pthread_mutex_unlock(&readerLock);
httpRedirection = "/" + humanReadableBookId + "/" + randomUrl;
}