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

Use std::unordered_map for TiffTreeStruct lookup #2305

Merged
merged 4 commits into from
Aug 4, 2022

Conversation

kevinbackhouse
Copy link
Collaborator

Same idea as #2299: use std::unordered_map for faster lookup.

@codecov
Copy link

codecov bot commented Aug 3, 2022

Codecov Report

Merging #2305 (453860a) into main (12b94bc) will increase coverage by 0.00%.
The diff coverage is 87.50%.

@@           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     
Impacted Files Coverage Δ
src/tiffimage_int.hpp 80.00% <ø> (ø)
src/tiffimage_int.cpp 78.99% <87.50%> (+0.81%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are these const?

Copy link
Collaborator Author

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.

src/tiffimage_int.hpp Outdated Show resolved Hide resolved
@neheb
Copy link
Collaborator

neheb commented Aug 4, 2022

⚔️ Conflicts

@@ -1830,8 +1830,8 @@ void TiffCreator::getPath(TiffPath& tiffPath, uint32_t extendedTag, IfdId group,
tiffPath.push(TiffPathItem(extendedTag, group));
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@kevinbackhouse
Copy link
Collaborator Author

rebased to fix the merge conflict

@neheb neheb merged commit 2e8ce71 into Exiv2:main Aug 4, 2022
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.

2 participants