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

Expose a way to check if a value has been seen before #5

Open
w4 opened this issue Feb 15, 2020 · 0 comments
Open

Expose a way to check if a value has been seen before #5

w4 opened this issue Feb 15, 2020 · 0 comments

Comments

@w4
Copy link
Owner

w4 commented Feb 15, 2020

We store hashes of each direct descendant's Storkable::value in each Storkable as a fix for #1 and we don't expose this to consumers. Right now consumers have to create a flat Vec and hash each Storkable::value themselves to check if they've seen the link before - even if they've all come from the same parent.

We need to figure out a good API to see if a "value" has been seen before from any parent, for example if the heirarchy looks like this:

root
↳ 123
 ↳ 456
  ↳ 789
↳ abc
 ↳ def
  ↳ ghi

We'd expect root.seen(789) and 123.seen(456) to be true but 456.seen(123) or abc.seen(123) not to be.

Right now children only hold references to their parents and not vice-versa so this lookup can currently only be done in reverse.

@w4 w4 changed the title Expose a way to check if a link has been seen before Expose a way to check if a value has been seen before Feb 15, 2020
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

No branches or pull requests

1 participant