Closed jonathantanmy closed 2 months ago
I think I wrote this safety comment very early when I started working on this and then didn't update it as the code evolved (as it's just an internal function). I did a patch release for the last fix since that could feasibly have negative effects but since this is just internal documentation and doesn't affect users I will merge this without cutting a release
Makes sense. Thanks for taking a look.
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.