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

Modernise code around iterators & smart pointers #2063

Merged
merged 8 commits into from
Feb 6, 2022
Merged

Conversation

piponazo
Copy link
Collaborator

@piponazo piponazo commented Feb 1, 2022

In this PR my main objective was to cleanup some code around the iterators & smart pointers:

  • Try to use auto when we are dealing with iterators since it makes the code much less verbose and without lossing clarity.
  • Use std::make_unique whenever possible when dealing with smart pointers. It reduces the amount of code and specially it avoids the usage of new and delete. This follows one of the rules in the C++ Core guidelines.
  • I also took the oportunity to simplify other parts of the code as I saw improvements opportunities. I tried to scope each change in a independent & atomic commit.

@piponazo piponazo self-assigned this Feb 1, 2022
@codecov
Copy link

codecov bot commented Feb 1, 2022

Codecov Report

Merging #2063 (93fe208) into main (fde0f9e) will decrease coverage by 0.16%.
The diff coverage is 51.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2063      +/-   ##
==========================================
- Coverage   62.04%   61.88%   -0.17%     
==========================================
  Files          96       96              
  Lines       19194    19054     -140     
  Branches     9833     9780      -53     
==========================================
- Hits        11909    11791     -118     
- Misses       4978     4980       +2     
+ Partials     2307     2283      -24     
Impacted Files Coverage Δ
include/exiv2/types.hpp 70.58% <ø> (ø)
src/convert.cpp 53.84% <ø> (ø)
src/cr2image.cpp 9.09% <0.00%> (ø)
src/epsimage.cpp 1.83% <0.00%> (+<0.01%) ⬆️
src/gifimage.cpp 21.42% <0.00%> (ø)
src/tgaimage.cpp 8.69% <0.00%> (ø)
src/tiffcomposite_int.hpp 89.18% <ø> (ø)
src/pngimage.cpp 64.04% <33.33%> (+0.16%) ⬆️
src/rw2image.cpp 36.36% <33.33%> (ø)
src/jpgimage.cpp 70.43% <37.50%> (-0.05%) ⬇️
... and 39 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fde0f9e...93fe208. Read the comment docs.

@piponazo piponazo added the refactoring Cleanup / Simplify code -> more readable / robust label Feb 4, 2022
@piponazo piponazo merged commit ac9439e into main Feb 6, 2022
@piponazo piponazo deleted the main_iterators branch February 6, 2022 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Cleanup / Simplify code -> more readable / robust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants