From 38d1a1a291b4dfdd460f8111c6bd86b4b3a16b1c Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 14 Sep 2016 15:06:35 +0200 Subject: [PATCH] faster message iteration --- storage/file.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/storage/file.js b/storage/file.js index 10adb7894..6663ae2d8 100644 --- a/storage/file.js +++ b/storage/file.js @@ -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);