From: scottmk Date: Sat, 14 Aug 2010 20:48:08 +0000 (+0000) Subject: Minor performance tweak: replace a call to buffer_add() X-Git-Tag: osrf_rel_2_0_1~115 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=526ca545ef879e2923440978cb6bfb2c049f8b83;p=OpenSRF.git Minor performance tweak: replace a call to buffer_add() 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 --- diff --git a/src/libopensrf/osrf_prefork.c b/src/libopensrf/osrf_prefork.c index 6531c2d..92e8288 100644 --- a/src/libopensrf/osrf_prefork.c +++ b/src/libopensrf/osrf_prefork.c @@ -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 )