Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vam: Add network_of() func #5306

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

vam: Add network_of() func #5306

wants to merge 1 commit into from

Conversation

mattnibs
Copy link
Collaborator

No description provided.

@mattnibs mattnibs requested a review from a team September 25, 2024 20:36
@mattnibs mattnibs force-pushed the vam-network-of branch 2 times, most recently from 2373fa5 to 2b0ef9e Compare September 26, 2024 02:21
Comment on lines -50 to +52
out := vector.NewArray(f.outerTyp, outOffs, inner, nil)
if len(errs) > 0 {
return vector.Combine(out, errs, vector.NewStringError(f.zctx, "missing", uint32(len(errs))))
}
return out
b := vector.NewCombiner(vector.NewArray(f.outerTyp, outOffs, inner, nil))
b.Add(errs, vector.NewStringError(f.zctx, "missing", uint32(len(errs))))
return b.Result()
Copy link
Member

Choose a reason for hiding this comment

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

vector.Combine feels like a better API here than vector.NewCombiner since the latter allocates a vector.Error even when len(errs)==0. Why not stick with it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Doesn't work for multiple error values

Copy link
Member

Choose a reason for hiding this comment

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

Then how about using an API that works for multiple error values when you need that and an API that doesn't do unnecessary allocations when you don't?

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