Skip to content

Conversation

dsa0x
Copy link
Member

@dsa0x dsa0x commented Feb 21, 2025

Fixes #

Target Release

1.13.x

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@dsa0x dsa0x added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Feb 21, 2025
@dsa0x dsa0x force-pushed the sams/graph-iter branch from d519339 to cc1ad10 Compare June 3, 2025 10:20
@dsa0x dsa0x force-pushed the sams/graph-iter branch from b7d4c2d to d05de09 Compare June 3, 2025 10:25
@dsa0x dsa0x marked this pull request as ready for review June 3, 2025 10:41
@dsa0x dsa0x requested a review from a team as a code owner June 3, 2025 10:41
@dsa0x dsa0x requested a review from liamcervante June 3, 2025 10:41
// SelectSeq filters a sequence to include only elements that can be type-asserted to type U.
// It returns a new sequence containing only the matching elements.
// The yield function can return false to stop iteration early.
func SelectSeq[T Vertex, U Vertex](seq VertexSeq[T], filter func(U)) VertexSeq[U] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need the filter function at all here? It's not being called, and you can specify the type using the [...] syntax: SelectSeq[MockVertex2, MockVertex](...).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was only there so that the type can be inferred, instead of the compulsory type constraint like this syntax, but it is probably better to use the natural syntax. Also, we actually only needed a single type constraint.

One type parameter seem to be enough instead of 2
@dsa0x dsa0x merged commit 2a79f5f into main Jun 3, 2025
10 of 11 checks passed
@dsa0x dsa0x deleted the sams/graph-iter branch June 3, 2025 11:57
Copy link
Contributor

github-actions bot commented Jul 4, 2025

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-changelog-needed Add this to your PR if the change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants