faster message iteration

This commit is contained in:
ansuz 2016-09-14 15:06:35 +02:00
parent b46f74cd78
commit 38d1a1a291
1 changed files with 4 additions and 2 deletions

View File

@ -148,8 +148,10 @@ var getMessages = function (env, chanName, handler, cb) {
}
try {
chan.messages
.filter(function (x) { return x; })
.forEach(handler);
.forEach(function (message) {
if (!message) { return; }
handler(message);
});
} catch (err2) {
console.error(err2);
cb(err2);