Skip to content

Commit

Permalink
Merge pull request #11 from f3l/010_bughunting
Browse files Browse the repository at this point in the history
Use correct type for zcards.
resolves #10
  • Loading branch information
pheerai committed Mar 20, 2016
2 parents 11c6d04 + abe6356 commit a2f5524
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ private:
}

string chooseCite() {
size_t zlen = db.zcard(dbKey);
long zlen = db.zcard(dbKey);
if ( zlen == 0 ) {
return "No cites in DB";
} else {
size_t ranIndex = uniform(0, zlen);
long ranIndex = uniform(0, zlen);
// zrange has inclusive start/stop
auto result = db.zrange(dbKey, ranIndex, ranIndex);
// We need to make sure that noone altered the DB during
Expand Down Expand Up @@ -58,7 +58,7 @@ public:
string title ="All quotes";
// Sort with descending key, e.g. newest quote in front
auto cites = db.zrevRange(dbKey, 0, -1);
size_t llen = db.zcard(dbKey);
long llen = db.zcard(dbKey);
render!("all.dt", title, cites, llen);
}

Expand Down

0 comments on commit a2f5524

Please sign in to comment.