Skip to content

Conversation

neheb
Copy link
Collaborator

@neheb neheb commented Oct 18, 2025

No description provided.

neheb added 5 commits October 18, 2025 14:28
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]>
@neheb neheb requested review from Copilot and kmilos October 18, 2025 21:29
Copy link

@Copilot Copilot AI left a 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 of const 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.

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.

1 participant