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

Move command out of the index.js

This commit is contained in:
Ruben Bridgewater
2015-09-30 02:03:37 +02:00
parent 29b31f749a
commit fba050802b
6 changed files with 53 additions and 44 deletions

View File

@@ -130,23 +130,23 @@ ReplyParser.prototype.execute = function (buffer) {
try {
type = this._buffer[this._offset++];
if (type === 43) { // +
if (type === 43) { // Strings +
ret = this._parseResult(type);
this.send_reply(ret);
} else if (type === 45) { // -
} else if (type === 45) { // Errors -
ret = this._parseResult(type);
this.send_error(ret);
} else if (type === 58) { // :
} else if (type === 58) { // Integers :
ret = this._parseResult(type);
this.send_reply(ret);
} else if (type === 36) { // $
} else if (type === 36) { // Bulk strings $
ret = this._parseResult(type);
this.send_reply(ret);
} else if (type === 42) { // 42 *
} else if (type === 42) { // Arrays *
// set a rewind point. if a failure occurs,
// wait for the next execute()/append() and try again
offset = this._offset - 1;