harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib][luni][HashMap]Avoid to expand data array in HashMap.putAll more than once.
Date Mon, 18 Sep 2006 16:52:04 GMT
Go for it.


Leo Li wrote:
> Hi, all:
>     Current implementation of HashMap.putAll() in Harmony just calls
> super.putAll() which ultimately will call HashMap.put(), while this way
> might lead to expand the backing data array more than once if the elements
> in the added Map is sufficiently large. However, the situation is able to
> be avoided, since we actually know the size of the added Map, thus the
> expected HashMap capacity.
>     If no one objects, I will add an expected capacity argument in internal
> rehash() method as rehash(int expectedCapacity) and rewrite  the
> HashMap.putAll().
>    Good luck!


Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message