From 852e3f2d609c4aac766405c27cd8c6774fb20a23 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Mon, 1 Oct 2007 18:44:18 -0700 Subject: [PATCH] Switching to pointer for read (mainly getting ready to do optimization) --- lib/memcached_io.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/memcached_io.c b/lib/memcached_io.c index a6e563d3..77df4319 100644 --- a/lib/memcached_io.c +++ b/lib/memcached_io.c @@ -8,8 +8,12 @@ ssize_t memcached_io_read(memcached_st *ptr, unsigned int server_key, char *buffer, size_t length) { size_t x; + char *buffer_ptr; - for (x= 0; x < length; x++) + buffer_ptr= buffer; + + for (x= 0, buffer_ptr= buffer; + x < length; x++) { if (!ptr->read_buffer_length) { @@ -23,7 +27,8 @@ ssize_t memcached_io_read(memcached_st *ptr, unsigned int server_key, if (ptr->read_buffer_length == 0) return x; } - buffer[x]= *ptr->read_ptr; + *buffer_ptr= *ptr->read_ptr; + buffer_ptr++; ptr->read_ptr++; ptr->read_buffer_length--; } -- 2.30.2