harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Li" <liyilei1...@gmail.com>
Subject [classlib][luni][HashMap]Avoid to expand data array in HashMap.putAll more than once.
Date Mon, 18 Sep 2006 01:32:49 GMT
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

    Good luck!

Leo Li
China Software Development Lab, IBM

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message