From 6d4469e3915edfcc76163f39d4885a19832ecdf7 Mon Sep 17 00:00:00 2001 From: brianc Date: Sun, 10 Oct 2010 22:44:13 -0500 Subject: [PATCH] code cleanup --- lib/client.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/client.js b/lib/client.js index 5a5aedfd..11beedad 100644 --- a/lib/client.js +++ b/lib/client.js @@ -17,7 +17,9 @@ var Client = function(config) { sys.inherits(Client, EventEmitter); -Client.prototype.connect = function() { +var p = Client.prototype; + +p.connect = function() { if(this.stream.readyState == 'closed'){ this.stream.connect(this.port, this.host); } @@ -54,12 +56,12 @@ Client.prototype.connect = function() { }); }; -Client.prototype.disconnect = function() { +p.disconnect = function() { var terminationBuffer = new Buffer([58,0,0,0,4]); this.stream.write(terminationBuffer); }; -Client.prototype.query = function(text) { +p.query = function(text) { var query = new Query(); query.client = this; query.text = text; @@ -68,7 +70,7 @@ Client.prototype.query = function(text) { return query; }; -Client.prototype.pulseQueryQueue = function() { +p.pulseQueryQueue = function() { if(!this.readyForQuery) { return; };