|
From: Lachlan A. <lac...@ip...> - 2003-02-01 04:59:46
|
Greetings Neal, That is a very sensible change, but I have two questions. First, in the change =09- if (s.length() > 0) =09- copy(s.Data, s.length(), s.length()); =09+ if (slen !=3D 0) =09+ copy(s.Data, slen, slen); was there a reason to replace the '>' by '!=3D'? It is defensive=20 programming not to copy negative-length strings. Second, do you know why gprof sees the calls to length() at all? =20 Shouldn't an inline function be optimised out? If so, the=20 optimisation becomes removing a few pointer dereferences (which=20 should also be optimised out by a sensible compiler). That said, I=20 agree that it is tidier not to rely on an optimising compiler. Cheers, Lachlan On Saturday 01 February 2003 12:20, Neal Richter wrote: > I've posted a patch to String.cc with some simple changes with make > a huge difference in efficiency. > Please take a look and tell me if you object to any change. > I'll commit it next week if no one sees a problem. |