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

Do not use items/layouts (mutable identifier) as hash key #1184

Merged
merged 1 commit into from Jun 13, 2017

Conversation

@ddfreyne
Copy link
Member

@ddfreyne ddfreyne commented Jun 11, 2017

Document’s @identifier is mutable, and is therefore not a good candidate for use in a hash key.

  • Add test case
  • Remove invariant check

Fixes #1185.

@ddfreyne ddfreyne force-pushed the mut-identifier-as-hash-key branch 2 times, most recently from 10d6f1c to 5e9d550 Jun 11, 2017
@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Jun 11, 2017

Alternative idea: Let the directed graph only contain references, e.g. [:item, '/foo.md'].

Loading

@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Jun 11, 2017

This breaks equality (two objects can be equal even if their hash is different)

Loading

@ddfreyne ddfreyne changed the title Do not use identifier (mutable) as hash key Do not use items/layouts (mutable identifier) as hash key Jun 12, 2017
@ddfreyne ddfreyne force-pushed the mut-identifier-as-hash-key branch from a8a5e81 to 6ae7500 Jun 13, 2017
@ddfreyne ddfreyne force-pushed the mut-identifier-as-hash-key branch from 6ae7500 to 23c69a2 Jun 13, 2017
@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Jun 13, 2017

The directed graph will now store only references, rather than objects themselves.

Loading

@ddfreyne ddfreyne merged commit 2f08e27 into master Jun 13, 2017
3 checks passed
Loading
@ddfreyne ddfreyne deleted the mut-identifier-as-hash-key branch Jun 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant