summaryrefslogtreecommitdiff
path: root/src/networking.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-07-24 11:21:39 +0200
committerantirez <antirez@gmail.com>2013-07-24 11:21:39 +0200
commit6ea8e0949c6cc6cd222c13f4a13d39fe8652f65e (patch)
treef5814a1fb54e2d877df52c0ee4e6579bd668dda0 /src/networking.c
parent75b760a72d916a91d86f5cf9531d95e0f524ec40 (diff)
downloadredis-6ea8e0949c6cc6cd222c13f4a13d39fe8652f65e.tar.gz
sdsrange() does not need to return a value.
Actaully the string is modified in-place and a reallocation is never needed, so there is no need to return the new sds string pointer as return value of the function, that is now just "void".
Diffstat (limited to 'src/networking.c')
-rw-r--r--src/networking.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/networking.c b/src/networking.c
index f7cfeb098..c131c9c67 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -866,7 +866,7 @@ int processInlineBuffer(redisClient *c) {
sdsfree(aux);
/* Leave data after the first line of the query in the buffer */
- c->querybuf = sdsrange(c->querybuf,querylen+2,-1);
+ sdsrange(c->querybuf,querylen+2,-1);
/* Setup argv array on client structure */
if (c->argv) zfree(c->argv);
@@ -895,7 +895,7 @@ static void setProtocolError(redisClient *c, int pos) {
sdsfree(client);
}
c->flags |= REDIS_CLOSE_AFTER_REPLY;
- c->querybuf = sdsrange(c->querybuf,pos,-1);
+ sdsrange(c->querybuf,pos,-1);
}
int processMultibulkBuffer(redisClient *c) {
@@ -933,7 +933,7 @@ int processMultibulkBuffer(redisClient *c) {
pos = (newline-c->querybuf)+2;
if (ll <= 0) {
- c->querybuf = sdsrange(c->querybuf,pos,-1);
+ sdsrange(c->querybuf,pos,-1);
return REDIS_OK;
}
@@ -982,7 +982,7 @@ int processMultibulkBuffer(redisClient *c) {
* try to make it likely that it will start at c->querybuf
* boundary so that we can optimized object creation
* avoiding a large copy of data. */
- c->querybuf = sdsrange(c->querybuf,pos,-1);
+ sdsrange(c->querybuf,pos,-1);
pos = 0;
/* Hint the sds library about the amount of bytes this string is
* going to contain. */
@@ -1021,7 +1021,7 @@ int processMultibulkBuffer(redisClient *c) {
}
/* Trim to pos */
- if (pos) c->querybuf = sdsrange(c->querybuf,pos,-1);
+ if (pos) sdsrange(c->querybuf,pos,-1);
/* We're done when c->multibulk == 0 */
if (c->multibulklen == 0) return REDIS_OK;