kdelibs/kdecore

Tim Jansen kde-optimize@mail.kde.org
Wed, 19 Mar 2003 22:55:43 +0100


On Wednesday 19 March 2003 21:12, Eray Ozkural wrote:
> -        Z *newdata = new Z[index + 1];
> +        // open table has amortized O(1) access time
> +        // when N elements appended -- exa
> +        Z *newdata = new Z[max(2 * sz, index+1)];

How can the rest of the code know that the array is bigger than index+1 if you 
don't modify it as well?

bye...