-
Notifications
You must be signed in to change notification settings - Fork 299
Fixes #3413
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
base: main
Are you sure you want to change the base?
Fixes #3413
Conversation
Signed-off-by: Rosen Penev <[email protected]>
Use for each loop instead of transform. The latter is overkill. Also use string_view. Lighterweight. Signed-off-by: Rosen Penev <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
Needed when using ostream modifiers. Signed-off-by: Rosen Penev <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
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.
Pull Request Overview
This PR makes various code quality improvements focused on const-correctness, return type optimizations, and stream formatting fixes. The changes improve function signatures to use std::string_view
for better performance, add const qualifiers where appropriate, and ensure proper stream state management.
- Modified string utility functions to accept
std::string_view
instead ofconst std::string&
- Added const qualifiers to methods and parameters that don't modify data
- Fixed stream formatting state management by saving and restoring flags
- Optimized return types to return references instead of copies where appropriate
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
src/utils.hpp | Changed function signatures to accept std::string_view parameters |
src/utils.cpp | Updated implementations to use std::string_view and manual loops instead of std::transform |
src/tiffimage.cpp | Added const qualifiers to pointer and reference parameters |
src/tiffcomposite_int.cpp | Added const qualifier to pointer variable |
src/preview.cpp | Changed return types to return const references |
src/pentaxmn_int.cpp | Added stream flags saving/restoring to prevent side effects |
src/orfimage.cpp | Added const qualifiers to pointer and reference parameters |
src/image_int.hpp | Updated documentation and added noexcept specifier, changed return type to auto |
src/image.cpp | Added const qualifier to method |
src/datasets.cpp | Changed range-based for loop to use const reference |
src/crwimage_int.cpp | Changed explicit type to auto for type deduction |
src/cr2image.cpp | Added const qualifiers to pointer and reference parameters |
include/exiv2/tiffimage.hpp | Added const qualifiers to reference parameters |
include/exiv2/slice.hpp | Updated documentation from @throw nothing to @note Does not throw |
include/exiv2/quicktimevideo.hpp | Renamed parameter from size to outer_size for clarity |
include/exiv2/preview.hpp | Changed return types to return const references |
include/exiv2/orfimage.hpp | Added const qualifiers to reference parameters |
include/exiv2/matroskavideo.hpp | Reordered method declaration to match usage order |
include/exiv2/jpgimage.hpp | Changed return type to return const reference |
include/exiv2/image.hpp | Added const qualifier to method |
include/exiv2/cr2image.hpp | Added const qualifiers to reference parameters |
include/exiv2/bmpimage.hpp | Added "Always" clarification to exception documentation |
app/actions.cpp | Added stream flags saving/restoring and refactored to use ostringstream |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
No description provided.