Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support getting number of children of non-existent vertex in Levelled Forest#8207

Merged
jordanschalm merged 1 commit into
masteronflow/flow-go:masterfrom
jord/levelled-forest-num-children-bugonflow/flow-go:jord/levelled-forest-num-children-bugCopy head branch name to clipboard
Nov 28, 2025
Merged

Support getting number of children of non-existent vertex in Levelled Forest#8207
jordanschalm merged 1 commit into
masteronflow/flow-go:masterfrom
jord/levelled-forest-num-children-bugonflow/flow-go:jord/levelled-forest-num-children-bugCopy head branch name to clipboard

Conversation

@jordanschalm

Copy link
Copy Markdown
Contributor

No description provided.

@jordanschalm
jordanschalm requested a review from a team as a code owner November 28, 2025 18:38
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

// GetNumberOfChildren returns number of children of given vertex
// GetNumberOfChildren returns the number of children of the given vertex that exist in the forest.
func (f *LevelledForest) GetNumberOfChildren(id flow.Identifier) int {
container := f.vertices[id] // if vertex does not exist, container is the default zero value for vertexContainer, which contains a nil-slice for its children

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This comment was wrong, because vertex containers were stored as pointers. Accessing fields on the returned nil pointer caused an exception.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jordanschalm
jordanschalm added this pull request to the merge queue Nov 28, 2025
Merged via the queue into master with commit 524b6d1 Nov 28, 2025
61 checks passed
@jordanschalm
jordanschalm deleted the jord/levelled-forest-num-children-bug branch November 28, 2025 21:22
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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.