On Tue, 2008-11-04 at 16:32 -0500, Dale Worley wrote:
> On Tue, 2008-11-04 at 16:22 -0500, Dans, Raymond (CAR:9D30) wrote:
> > I don't think its as much a problem in myvsprintf as it was in the
> > "escape" method.  I just looked through this method and noticed that it
> > could be a little smarter.
> 
> Ugh, yes!  escape() uses UtlString::append().  Ultimately, all the
> UtlString::append() methods use UtlString::capacity() to resize the
> string, which if you are appending single characters, adds only 100
> characters at a time.

While we're at it, we should fix UtlString::capacity to add a particular
percentage of the length of the string, rather than a fixed number of
bytes.  As it is currently, any code that adds a large number of items
to a string will tend to have N^2 running time.

Dale


_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev

Reply via email to