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

strcmp to == conversions #2301

Merged
merged 1 commit into from
Aug 3, 2022
Merged

strcmp to == conversions #2301

merged 1 commit into from
Aug 3, 2022

Conversation

neheb
Copy link
Collaborator

@neheb neheb commented Aug 2, 2022

Does the same thing.

Signed-off-by: Rosen Penev rosenp@gmail.com

Does the same thing.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #2301 (b3c0b2a) into main (ee5dae4) will increase coverage by 0.00%.
The diff coverage is 42.85%.

@@           Coverage Diff           @@
##             main    #2301   +/-   ##
=======================================
  Coverage   63.53%   63.54%           
=======================================
  Files         118      118           
  Lines       19595    19595           
  Branches     9576     9576           
=======================================
+ Hits        12450    12451    +1     
+ Misses       5079     5078    -1     
  Partials     2066     2066           
Impacted Files Coverage Δ
app/actions.cpp 64.97% <0.00%> (ø)
app/exiv2.cpp 62.48% <0.00%> (ø)
src/easyaccess.cpp 93.10% <0.00%> (ø)
src/tiffvisitor_int.cpp 79.45% <33.33%> (ø)
src/properties.cpp 75.11% <37.50%> (ø)
src/tiffcomposite_int.cpp 75.70% <50.00%> (+0.10%) ⬆️
src/datasets.cpp 93.12% <100.00%> (ø)
src/tags.cpp 67.05% <100.00%> (ø)
src/types.cpp 94.47% <100.00%> (ø)

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

Copy link
Collaborator

@piponazo piponazo left a comment

Choose a reason for hiding this comment

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

LGTM

@neheb neheb merged commit e74feff into Exiv2:main Aug 3, 2022
@neheb neheb deleted the 2 branch August 3, 2022 08:36
@@ -24,8 +24,8 @@ uint32_t fillGap(Exiv2::Internal::IoWrapper& ioWrapper, uint32_t curr, uint32_t
// class member definitions
namespace Exiv2::Internal {
bool TiffMappingInfo::operator==(const TiffMappingInfo::Key& key) const {
return (0 == strcmp("*", make_) || 0 == strncmp(make_, key.m_.c_str(), strlen(make_))) &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one is checking that make_ is a prefix of key.m_, so it can't be converted to ==.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@neheb: I accidentally clicked "start a review" before, so this comment was left in a pending state.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've created #2307 to use startsWith 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.

Ah strncmp, yes.

kevinbackhouse added a commit to kevinbackhouse/exiv2 that referenced this pull request Aug 4, 2022
@kevinbackhouse kevinbackhouse mentioned this pull request Aug 4, 2022
neheb pushed a commit that referenced this pull request 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.

3 participants