Skip to content

fix(compare): ensure images are sorted without modifying input slices#276

Merged
k1LoW merged 1 commit intomainfrom
fix-image-sort
Jul 18, 2025
Merged

fix(compare): ensure images are sorted without modifying input slices#276
k1LoW merged 1 commit intomainfrom
fix-image-sort

Conversation

@k1LoW
Copy link
Owner

@k1LoW k1LoW commented Jul 18, 2025

This pull request refactors the imagesEqual function in compare.go to ensure that the original slices of images remain unmodified during comparison by copying and sorting them into new slices before performing equality checks.

Refactoring for immutability:

  • compare.go: Updated the imagesEqual function to create copies of the input slices (images1 and images2) before sorting them. This prevents unintended modifications to the original slices during the sorting process.

@k1LoW k1LoW self-assigned this Jul 18, 2025
@k1LoW k1LoW added the bug Something isn't working label Jul 18, 2025
@github-actions
Copy link
Contributor

Code Metrics Report

main (7c2ac62) #276 (0b5859b) +/-
Coverage 36.6% 36.8% +0.1%
Code to Test Ratio 1:0.8 1:0.8 -0.1
Test Execution Time 9s 13s +4s
Details
  |                     | main (7c2ac62) | #276 (0b5859b) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          36.6% |          36.8% | +0.1% |
  |   Files             |             17 |             17 |     0 |
  |   Lines             |           2319 |           2323 |    +4 |
+ |   Covered           |            851 |            855 |    +4 |
- | Code to Test Ratio  |          1:0.8 |          1:0.8 |  -0.1 |
  |   Code              |           4717 |           4721 |    +4 |
  |   Test              |           4177 |           4177 |     0 |
- | Test Execution Time |             9s |            13s |   +4s |

Code coverage of files in pull request scope (59.3% → 60.6%)

Files Coverage +/- Status
compare.go 60.6% +1.2% modified

Reported by octocov

@k1LoW k1LoW marked this pull request as ready for review July 18, 2025 14:22
@k1LoW k1LoW merged commit cc7bd8f into main Jul 18, 2025
1 check passed
@k1LoW k1LoW deleted the fix-image-sort branch July 18, 2025 14:22
@github-actions github-actions bot mentioned this pull request Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant