From 5a8061bf5f84fedbc3a010747934a39b70c5a840 Mon Sep 17 00:00:00 2001 From: brianc Date: Sun, 10 Oct 2010 19:09:24 -0500 Subject: [PATCH] unrolled loop --- lib/index.js | 7 ++++--- test/unit/test-helper.js | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index a712ab37..01c36bc8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -48,11 +48,12 @@ Client.prototype.connect = function() { this.stream.on('data', function(data) { var parser = new Parser(data); - var result = parser.parse(); - result.forEach(function(msg) { + var msg = parser.parseMessage(); + while(msg) { self.emit('message', msg); self.emit(msg.name, msg); - }); + msg = parser.parseMessage(); + } }); this.on('ReadyForQuery', function() { diff --git a/test/unit/test-helper.js b/test/unit/test-helper.js index de2836bf..d715caf1 100644 --- a/test/unit/test-helper.js +++ b/test/unit/test-helper.js @@ -51,8 +51,6 @@ test = function(name, action) { console.log(name); console.log(e.toString()); } - - test.tabout -= 2; }; test.tabout = 0;