tcpan / sparsehash

Automatically exported from code.google.com/p/sparsehash
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Insert deleted key into hashmap will cause size() be increased #92

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Initiate a HashMap  (such as google::sparse_hash_map<int, int> hashmap;)
2. Set the deleted key  (hashmap.set_deleted_key(-1);)
3. Insert a delete key into it (hashmap.insert(std::make_pair(-1, -1 * 100));)
4. Check its size by call size() method, the size() is increased; but it is 
unable to be get via iterator.  

What is the expected output? What do you see instead?
If insert a deleted key, the size() should not be increased.

What version of the product are you using? On what operating system?
1.11 on Centos

Please provide any additional information below.

Original issue reported on code.google.com by Lingtao....@gmail.com on 7 May 2013 at 9:24