Minor performance tweak: replace a call to buffer_add()
authorscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Sat, 14 Aug 2010 20:48:08 +0000 (20:48 +0000)
committerscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Sat, 14 Aug 2010 20:48:08 +0000 (20:48 +0000)
with a call to buffer_add_n().

In this case we already know how many characters to add,
so we can avoid a call to strlen().

M    src/libopensrf/osrf_prefork.c

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@2002 9efc2488-bf62-4759-914b-345cdb29e865

src/libopensrf/osrf_prefork.c

index 6531c2d..92e8288 100644 (file)
@@ -966,7 +966,7 @@ static void prefork_child_wait( prefork_child* child ) {
                                set_fl( child->read_data_fd, O_NONBLOCK );
                                gotdata = 1;
                        }
-                       buffer_add( gbuf, buf );
+                       buffer_add_n( gbuf, buf, n );
                }
 
                if( errno == EAGAIN )