Skip to content

Conversation

@NavyaZaveri
Copy link

@NavyaZaveri NavyaZaveri commented May 22, 2020

With the current implementation, this test fails:

  #[test]
    fn test_size() {
        let mut mmap = MultiMap::<i32, String>::new();
        mmap.insert(1, "abc".into());
        mmap.insert(1, "abc".into());
        mmap.delete(1, "abc".into());
        assert_eq!( mmap.size(),0)
    }

The reason for this is that counter was being incremented for every insert, even if the key-value pair was a duplicate.

Note: this PR is built on top of the previous PR #5

@NavyaZaveri NavyaZaveri force-pushed the bugfix_multimap_size branch from cd1006a to 5fe9a9f Compare May 22, 2020 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant