On Apr 8, 2009, at 9:02 PM, ZHOU Xiao-bo wrote:
WTF::Hashmap::iterator uses WTF::HashTable::iterator as its
m_impl.
When you call 'remove( oldIter )', the current 'iter' may be
changed. And
it's not about memory reallocation or element shift,
That’s incorrect. It is about memory reallocation and element shift.
In the remove function HashTable is the following code:
if (shouldShrink())
shrink();
The shrink function can change the size of the hash table and thus
rehash everything and change the order of all the elements in it.
So, how can I delete an element of a HashMap when I traversing the
container?
You can’t.
-- Darin
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev