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

Refactor oslMoveImageTo function for clarity and robustness #55

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

dogo
Copy link
Owner

@dogo dogo commented Sep 2, 2024

Summary

This PR refactors the oslMoveImageTo function for better clarity and error handling.

Changes

  • Early Return: The function now exits early if the image is already in the desired location.
  • Improved Error Handling: Restores the original data pointer if memory allocation fails.
  • Code Clean-Up: Added comments and replaced numeric booleans with true/false.

Impact

These changes enhance the function's readability and reliability without altering its behavior.

- Added early return if the image is already at the desired location to avoid unnecessary processing.
- Improved error handling by restoring the original data pointer if memory allocation fails.
- Enhanced code readability with clear comments and logical flow.
- Replaced numeric boolean values with `true` and `false` for better clarity.
@dogo dogo merged commit d5aebff into master Sep 2, 2024
6 checks passed
@dogo dogo deleted the refactor/oslMoveImageTo branch September 2, 2024 17:43
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