Skip to content

refactor(gateway): use slices.SortFunc for peer ordering - #5551

Merged
pfi79 merged 1 commit into
hyperledger:mainfrom
elonfliter:feature_for_elon
Oct 19, 2026
Merged

pfi79 merged 1 commit into
hyperledger:mainfrom
elonfliter:feature_for_elon

Conversation

@elonfliter

Copy link
Copy Markdown
Contributor

Type of change

Improvement (improvement to code, performance, etc)

Description

Replace the gateway peer ordering comparator with slices.SortFunc, preserving height ordering and local-peer preference.

Additional details

The comparator now returns the int result required by slices.SortFunc; registry selection semantics are unchanged.

Related issues

N/A (maintenance refactor).

Tested with go test ./internal/pkg/gateway.

@elonfliter
elonfliter requested a review from a team as a code owner August 31, 2026 10:03
Comment thread internal/pkg/gateway/registry.go Outdated
Comment thread internal/pkg/gateway/registry.go
Signed-off-by: elonfliter <elonfliter@outlook.com>
@elonfliter

Copy link
Copy Markdown
Contributor Author

@pfi79 Please review it again.

@mergify

mergify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@pfi79
pfi79 merged commit f9b03bf into hyperledger:main Oct 19, 2026
15 checks passed
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