Bugs in java.util.ArrayList, java.util.Hashtable and java.io.ByteArrayOutputStream
Ulf Zibis
Ulf.Zibis at gmx.de
Wed Mar 10 17:36:48 UTC 2010
Am 10.03.2010 00:22, schrieb Martin Buchholz:
> On Tue, Mar 9, 2010 at 15:11, Ulf Zibis<Ulf.Zibis at gmx.de> wrote:
>
>
>> Can you explain the mystery about "+ 2" ?
>>
> It's exactly the same as the old resizing behavior.
In detail I meant, if you have any idea, why the original designers
could have chosen the "+1".
The code would be smarter, if ommited, + would serve the algorithm-loved
arrays of [base-2-] "round" sizes.
-Ulf
More information about the core-libs-dev
mailing list