Skip to content

Commit

Permalink
verify: remove process.nextTick (#302)
Browse files Browse the repository at this point in the history
running synchronous code asynchronously using process.nextTick
has a negative latency impact
  • Loading branch information
ilyapx authored and ziluvatar committed Sep 6, 2017
1 parent 0be5409 commit 3305cf0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions verify.js
Expand Up @@ -21,12 +21,7 @@ module.exports = function (jwtString, secretOrPublicKey, options, callback) {
var done;

if (callback) {
done = function() {
var args = Array.prototype.slice.call(arguments, 0);
return process.nextTick(function() {
callback.apply(null, args);
});
};
done = callback;
} else {
done = function(err, data) {
if (err) throw err;
Expand Down

0 comments on commit 3305cf0

Please sign in to comment.