Skip to content

Commit

Permalink
Fix small bug in redis backend
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Jul 8, 2014
1 parent dff4589 commit 4076903
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions db-redis.cpp
Expand Up @@ -134,11 +134,11 @@ void DBRedis::loadPosCache()
if(reply->type != REDIS_REPLY_ARRAY)
throw std::runtime_error("Failed to get keys from database");
for(size_t i = 0; i < reply->elements; i++) {
if(!reply->element[i]->type == REDIS_REPLY_STRING)
if(reply->element[i]->type != REDIS_REPLY_STRING)
throw std::runtime_error("Got wrong response to 'HKEYS %s' command");
posCache.push_back(decodeBlockPos(stoi64(reply->element[i]->str)));
}

freeReplyObject(reply);
}

Expand All @@ -164,4 +164,3 @@ void DBRedis::getBlocksOnZ(std::map<int16_t, BlockList> &blocks, int16_t zPos)
freeReplyObject(reply);
}
}

0 comments on commit 4076903

Please sign in to comment.