1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00

Fix style.

This commit is contained in:
Matt Ranney
2011-11-13 20:12:22 -10:00
parent 82cc930bc7
commit dfcfaf3dc5

View File

@@ -206,7 +206,6 @@ RedisClient.prototype.on_connect = function () {
if (this.auth_pass) { if (this.auth_pass) {
this.do_auth(); this.do_auth();
} else { } else {
// restore the selected db if needed // restore the selected db if needed
if (this.selected_db !== null) { if (this.selected_db !== null) {
this.send_command('select', [this.selected_db]); this.send_command('select', [this.selected_db]);
@@ -740,22 +739,19 @@ commands.forEach(function (command) {
// store db in this.select_db to restore it on reconnect // store db in this.select_db to restore it on reconnect
RedisClient.prototype.select = function (db, callback) { RedisClient.prototype.select = function (db, callback) {
var self = this; var self = this;
this.send_command('select', [db], function (err, res) { this.send_command('select', [db], function (err, res) {
if (err === null) { if (err === null) {
self.selected_db = db; self.selected_db = db;
} }
if (typeof(callback) !== 'undefined') { if (typeof(callback) === 'function') {
callback(err, res); callback(err, res);
} }
}); });
} };
RedisClient.prototype.SELECT = RedisClient.prototype.select; RedisClient.prototype.SELECT = RedisClient.prototype.select;
// Stash auth for connect and reconnect. Send immediately if already connected. // Stash auth for connect and reconnect. Send immediately if already connected.
RedisClient.prototype.auth = function () { RedisClient.prototype.auth = function () {
var args = to_array(arguments); var args = to_array(arguments);