@@ -624,14 +624,14 @@ RedisClient.prototype.return_reply = function (reply) {
624624
625625 if ( command_obj && ! command_obj . sub_command ) {
626626 if ( typeof command_obj . callback === "function" ) {
627- if ( this . options . detect_buffers && command_obj . buffer_args === false && 'exec' !== command_obj . command . toLowerCase ( ) ) {
627+ if ( this . options . detect_buffers && command_obj . buffer_args === false && 'exec' !== command_obj . command ) {
628628 // If detect_buffers option was specified, then the reply from the parser will be Buffers.
629629 // If this command did not use Buffer arguments, then convert the reply to Strings here.
630630 reply = reply_to_strings ( reply ) ;
631631 }
632632
633633 // TODO - confusing and error-prone that hgetall is special cased in two places
634- if ( reply && 'hgetall' === command_obj . command . toLowerCase ( ) ) {
634+ if ( reply && 'hgetall' === command_obj . command ) {
635635 reply = reply_to_object ( reply ) ;
636636 }
637637
@@ -692,7 +692,7 @@ function Command(command, args, sub_command, buffer_args, callback) {
692692}
693693
694694RedisClient . prototype . send_command = function ( command , args , callback ) {
695- var arg , command_obj , i , il , elem_count , buffer_args , stream = this . stream , command_str = "" , buffered_writes = 0 , last_arg_type , lcaseCommand ;
695+ var arg , command_obj , i , il , elem_count , buffer_args , stream = this . stream , command_str = "" , buffered_writes = 0 , last_arg_type ;
696696
697697 if ( typeof command !== "string" ) {
698698 throw new Error ( "First argument to send_command must be the command name string, not " + typeof command ) ;
@@ -730,8 +730,7 @@ RedisClient.prototype.send_command = function (command, args, callback) {
730730 // client.sadd(arg1, [arg2, arg3, arg4], cb);
731731 // converts to:
732732 // client.sadd(arg1, arg2, arg3, arg4, cb);
733- lcaseCommand = command . toLowerCase ( ) ;
734- if ( ( lcaseCommand === 'sadd' || lcaseCommand === 'srem' ) && args . length > 0 && Array . isArray ( args [ args . length - 1 ] ) ) {
733+ if ( ( command === 'sadd' || command === 'srem' ) && args . length > 0 && Array . isArray ( args [ args . length - 1 ] ) ) {
735734 args = args . slice ( 0 , - 1 ) . concat ( args [ args . length - 1 ] ) ;
736735 }
737736
@@ -885,7 +884,7 @@ RedisClient.prototype.end = function () {
885884
886885function Multi ( client , args ) {
887886 this . _client = client ;
888- this . queue = [ [ "MULTI " ] ] ;
887+ this . queue = [ [ "multi " ] ] ;
889888 if ( Array . isArray ( args ) ) {
890889 this . queue = this . queue . concat ( args ) ;
891890 }
@@ -1061,7 +1060,7 @@ Multi.prototype.exec = function (callback) {
10611060 if ( args . length === 1 && Array . isArray ( args [ 0 ] ) ) {
10621061 args = args [ 0 ] ;
10631062 }
1064- if ( command . toLowerCase ( ) === 'hmset' && typeof args [ 1 ] === 'object' ) {
1063+ if ( command === 'hmset' && typeof args [ 1 ] === 'object' ) {
10651064 obj = args . pop ( ) ;
10661065 Object . keys ( obj ) . forEach ( function ( key ) {
10671066 args . push ( key ) ;
@@ -1081,7 +1080,7 @@ Multi.prototype.exec = function (callback) {
10811080 } , this ) ;
10821081
10831082 // TODO - make this callback part of Multi.prototype instead of creating it each time
1084- return this . _client . send_command ( "EXEC " , [ ] , function ( err , replies ) {
1083+ return this . _client . send_command ( "exec " , [ ] , function ( err , replies ) {
10851084 if ( err ) {
10861085 if ( callback ) {
10871086 errors . push ( new Error ( err ) ) ;
@@ -1106,7 +1105,7 @@ Multi.prototype.exec = function (callback) {
11061105 }
11071106
11081107 // TODO - confusing and error-prone that hgetall is special cased in two places
1109- if ( reply && args [ 0 ] . toLowerCase ( ) === "hgetall" ) {
1108+ if ( reply && args [ 0 ] === "hgetall" ) {
11101109 replies [ i - 1 ] = reply = reply_to_object ( reply ) ;
11111110 }
11121111
0 commit comments