Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve HashMap/Set situation #137

Merged
merged 5 commits into from Nov 16, 2018
Merged

Improve HashMap/Set situation #137

merged 5 commits into from Nov 16, 2018

Conversation

niklas88
Copy link
Member

@niklas88 niklas88 commented Oct 4, 2018

This starts work on issue #136 by using inheritance plus using
declerations instead of explicit method wrapping. This also fixes the
broken insert() method which couldn't actually be used as no call to it
could ever compile.

Also adds rudimentary sanity tests (the underlying implementations
should be well tested already).

@niklas88 niklas88 added this to In progress in QLever Oct 8, 2018
@niklas88 niklas88 moved this from In progress to Review in QLever Oct 10, 2018
@niklas88 niklas88 mentioned this pull request Nov 14, 2018
QLever automation moved this from Review to Review Approved Nov 15, 2018
Copy link
Member

@floriankramer floriankramer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me, apart from one or two minor things. Especially the comparator when creating the patterns vector looks a lot cleaner.
How would you suggest we go about switching out the current usage of std::unordered_map with HashMap? I'd suggest creating one pr that replaces all usages of unordered_map with hash map, but depending on the amount of other pending changes that might be unfeasible due to the amount of files changed.

ASSERT_EQ(maptwo["bar"], 41);
};

int main(int argc, char** argv) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other tests link against 'gtest_main' for a main method.

@niklas88
Copy link
Member Author

I've changed all possible uses in master using sed. Two uses with Pattern however can't currently be replaced and I'd do that in an extra PR

This starts work on issue #136 by using inheritance plus using
declerations instead of explicit method wrapping. This also fixes the
broken insert() method which couldn't actually be used as no call to it
could ever compile.

Also adds rudimentary sanity tests (the underlying implementations
should be well tested already).
This makes IndexTest independent of the order of the entries in the
patternCounts hash map
Used `sed` to refactor `std::unordered_map` except one where
`ad_utility::HashMap` currently doesn't work because of missing
`DELETED_KEY` or `iterator`
@niklas88 niklas88 merged commit c998852 into ad-freiburg:master Nov 16, 2018
QLever automation moved this from Review Approved to Done Nov 16, 2018
@niklas88 niklas88 deleted the hash_map_cleanup branch July 19, 2019 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
QLever
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants