Skip to content

Remove redundant casts - #231

Open
FranciscoTGouveia wants to merge 1 commit into
PSeitz:mainfrom
FranciscoTGouveia:remove-casts
Open

Remove redundant casts#231
FranciscoTGouveia wants to merge 1 commit into
PSeitz:mainfrom
FranciscoTGouveia:remove-casts

Conversation

@FranciscoTGouveia

Copy link
Copy Markdown

I believe these casts can be safely removed, as the source type is already the target type.

For reference, these changes were found by an optimizer developed as a research project.

CC @nunoplopes

Copilot AI review requested due to automatic review settings July 26, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown

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 removes redundant as usize casts when adding the result of read_integer(...) to literal_length and match_length during safe block decompression. This aligns the call sites with read_integer’s existing return type (Result<usize, DecompressError>), keeping the decompression logic unchanged while simplifying the code.

Changes:

  • Removed as usize casts after read_integer(input, &mut input_pos)? when updating literal_length.
  • Removed as usize casts after read_integer(input, &mut input_pos)? when updating match_length.

💡 Add Copilot custom instructions for smarter, more guided reviews. 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.

2 participants