myers/middle_snake: correct safety doc #11
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, one last thing that my colleague noticed. This PR is assuming that
bounds_check
is correct - I haven't scrutinized the algorithm enough to determine what the exact bounds are.Again, feel free to change to meet your project's style. (This passes
cargo fmt
, but I don't know how long you prefer your documentation lines to be.)Commit message follows:
In the documentation for MiddleSnakeSearch::new, the safety constraints described on the
data
pointer do not exactly match how the class uses it. It is stored as thekvec
field, and looking at thewrite_xpos_at_diagonal
,x_pos_at_diagonal
, andpos_at_diagonal
functions (a search ofkvec
in the source code revealing that all access tokvec
go through one of these functions):Therefore, update the documentation accordingly.