-
Notifications
You must be signed in to change notification settings - Fork 278
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
Use std::unordered_map for TiffTreeStruct lookup #2305
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2305 +/- ##
=======================================
Coverage 63.41% 63.42%
=======================================
Files 118 118
Lines 19635 19634 -1
Branches 9606 9607 +1
=======================================
+ Hits 12451 12452 +1
+ Misses 5113 5112 -1
+ Partials 2071 2070 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
src/tiffimage_int.hpp
Outdated
using Key = std::pair<uint32_t, IfdId>; | ||
//! Comparison operator to compare a TiffTreeStruct with a TiffTreeStruct::Key | ||
bool operator==(const Key& key) const; | ||
const IfdId parentGroup_; //!< Parent group |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right: I didn't need to do that. I also didn't need to add the constructor. I've removed them.
⚔️ Conflicts |
src/tiffimage_int.cpp
Outdated
@@ -1830,8 +1830,8 @@ void TiffCreator::getPath(TiffPath& tiffPath, uint32_t extendedTag, IfdId group, | |||
tiffPath.push(TiffPathItem(extendedTag, group)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this is funny. clang-tidy should but is not recommending emplace() here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
e8069d0
to
48070a2
Compare
rebased to fix the merge conflict |
Same idea as #2299: use
std::unordered_map
for faster lookup.