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

Fix sparse file test offset/length #263

Merged
merged 2 commits into from
Mar 10, 2024

Conversation

bearrito
Copy link
Contributor

@bearrito bearrito commented Mar 9, 2024

Fixes #262

length := rand.Intn(int(index.Index.ChunkSizeMax))
offset := rand.Intn(int(index.Length()) - length)
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't this be?

offset := rand.Intn(int(index.Length()) - length - 1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Three hard things in computer science: off-by-one errors and naming things.

I'll fix it up.

@folbricht folbricht merged commit 7502cbb into folbricht:master Mar 10, 2024
3 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.

Failing sparsefile tests
2 participants