Skip to content

Commit

Permalink
minor code improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
palamccc committed Dec 23, 2015
1 parent 04698c5 commit cc85e2a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/warlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ module.exports = function(redis){
function(err, lockSet) {
if (err) return cb(err);

var unlock = warlock.unlock.bind(warlock, key, id);
if (!lockSet) unlock = false;
var unlock = lockSet ? warlock.unlock.bind(warlock, key, id) : false;

return cb(err, unlock);
}
Expand Down

0 comments on commit cc85e2a

Please sign in to comment.