Skip to content

Fix sort comparator bug: pkgs[i] should be pkgs[j]#5

Open
Avicennasis wants to merge 1 commit into
wgtunnel:mainfrom
Avicennasis:fix/sort-comparator-bug
Open

Fix sort comparator bug: pkgs[i] should be pkgs[j]#5
Avicennasis wants to merge 1 commit into
wgtunnel:mainfrom
Avicennasis:fix/sort-comparator-bug

Conversation

@Avicennasis

Copy link
Copy Markdown

Summary

  • Fix pkgs[i].VersionNamepkgs[j].VersionName on line 54 of metascoop/apps/index.go
  • The sort.Slice less function compared pkgs[i].VersionName against itself instead of pkgs[j].VersionName, making the version-name fallback comparison a no-op

Notes

This is a functional bug fix — the version-name sort path never actually compared two different elements. The VersionCode comparison on line 45-46 still works correctly, so this only affects packages where version codes are equal but version names differ.

The sort.Slice less function compared pkgs[i].VersionName against
itself instead of pkgs[j].VersionName, making the version-name
fallback comparison a no-op.
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