diff options
author | antirez <antirez@gmail.com> | 2011-09-22 16:00:40 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2011-09-22 16:00:40 +0200 |
commit | f96a8a8054b3b699c2fba797bdcd203dda1168ce (patch) | |
tree | ff487b6d6a7ec118c2095df73e8c523f76b42de9 /src/rio.c | |
parent | 69cecb511fef03795e94ba819308262ea44b2a18 (diff) | |
download | redis-f96a8a8054b3b699c2fba797bdcd203dda1168ce.tar.gz |
rioInitWithFile nad rioInitWithBuffer functions now take a rio structure pointer to avoid copying a structure to return value to the caller.
Diffstat (limited to 'src/rio.c')
-rw-r--r-- | src/rio.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -52,16 +52,15 @@ static const rio rioFileIO = { { { NULL, 0 } } /* union for io-specific vars */ }; -rio rioInitWithFile(FILE *fp) { - rio r = rioFileIO; - r.io.file.fp = fp; - return r; +void rioInitWithFile(rio *r, FILE *fp) { + *r = rioFileIO; + r->io.file.fp = fp; } -rio rioInitWithBuffer(sds s) { - rio r = rioBufferIO; - r.io.buffer.ptr = s; - r.io.buffer.pos = 0; - return r; + +void rioInitWithBuffer(rio *r, sds s) { + *r = rioBufferIO; + r->io.buffer.ptr = s; + r->io.buffer.pos = 0; } /* Write multi bulk count in the format: "*<count>\r\n". */ |