mirror of
https://github.com/hanzoai/node-jsonwebtoken.git
synced 2026-09-24 17:00:48 +00:00
verify: remove process.nextTick (#302)
running synchronous code asynchronously using process.nextTick has a negative latency impact
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user