[Libguestfs] [PATCH 1/2] daemon: Add a trim utility function.

Richard W.M. Jones rjones at redhat.com
Thu Mar 18 15:22:38 UTC 2010


On Thu, Mar 18, 2010 at 04:04:32PM +0100, Jim Meyering wrote:
> It probably doesn't matter, since this function
> is unlikely to be applied in an inner loop or to very long
> strings with lots of leading and trailing blanks, but...
> 
> You could write this function so that it reads the input string
> only once, rather than 2 or 3 times.

Thanks -- I've made some adjustments to this function.  Speedwise it's
not hugely important when you consider that we immediately dispatch
the strings over an RPC-encoded loopback network socket.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html




More information about the Libguestfs mailing list