Skip to content

Commit

Permalink
Update watch and mget to use array arguments
Browse files Browse the repository at this point in the history
This is a small performance improvement since the `redis` module offers
a straight passthrough mode for command callbacks, since it does not
rely on parsing `arguments`.
  • Loading branch information
Rui Marinho committed Dec 31, 2014
1 parent 62794c3 commit dbbd1cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ Limiter.prototype.get = function (fn) {
}

function mget() {
db.watch(count, function (err) {
db.watch([count], function (err) {
if (err) return fn(err);
db.mget(count, limit, reset, function (err, res) {
db.mget([count, limit, reset], function (err, res) {
if (err) return fn(err);
if (!res[0] && res[0] !== 0) return create();

Expand Down

0 comments on commit dbbd1cb

Please sign in to comment.