P
Pankaj
Hi All,
I use a Hashtable in my program to keep unique items...at one instance I
need to repopulate this hashtable through a loop.
when starting repopulation hashtable.count() returns ZERO hence first item
gets added successfully but as soon as the control reaches top of foreach
loop
somehow a second item which indeed existed before repoulation started
appears in hashtable and count returns two hence this second item can not
add itself because of duplicate key.
I tried allocating a new object to hashtable as well as clear() before
repopulating but same weird behaviour.
At the end I have to check in repopulation code that if key existed then
dont add it ...my code worked for time
but just wondering....why why why?
Any thoughts ?
-TIA
Pankaj
I use a Hashtable in my program to keep unique items...at one instance I
need to repopulate this hashtable through a loop.
when starting repopulation hashtable.count() returns ZERO hence first item
gets added successfully but as soon as the control reaches top of foreach
loop
somehow a second item which indeed existed before repoulation started
appears in hashtable and count returns two hence this second item can not
add itself because of duplicate key.
I tried allocating a new object to hashtable as well as clear() before
repopulating but same weird behaviour.
At the end I have to check in repopulation code that if key existed then
dont add it ...my code worked for time
but just wondering....why why why?
Any thoughts ?
-TIA
Pankaj