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

handling edge cases in reconstruct API #39

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

Conversation

Thejas-bhat
Copy link
Member

No description provided.

}

// exit in case of invalid input
if n == 0 || len(recons) != int(n)*idx.D() {
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps the n == 0 check should be moved up before the recons alloc - line 333.5.

Copy link
Member Author

Choose a reason for hiding this comment

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

technically speaking this is still the first validation check, so i dont think it would cause issues if we keep it over here. (just that moving the n == 0 check will have three separate if conditions which wouldn't look good i guess)

the condition at 334 doesn't exit the function, since its for when some user doesn't know what exactly to give for recons (which is like a prealloc) - in which case the function explicitly allocs the slice.

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