Skip to content

Cleanup fixed hash#2809

Merged
chriseth merged 1 commit intodevelopfrom
cleanupFixedHash
Aug 25, 2017
Merged

Cleanup fixed hash#2809
chriseth merged 1 commit intodevelopfrom
cleanupFixedHash

Conversation

@chriseth
Copy link
Contributor

Depends on #2808

@@ -97,33 +89,14 @@ class FixedHash
bool operator==(FixedHash const& _c) const { return m_data == _c.m_data; }
bool operator!=(FixedHash const& _c) const { return m_data != _c.m_data; }
bool operator<(FixedHash const& _c) const { for (unsigned i = 0; i < N; ++i) if (m_data[i] < _c.m_data[i]) return true; else if (m_data[i] > _c.m_data[i]) return false; return false; }
Copy link
Contributor

@axic axic Aug 25, 2017

Choose a reason for hiding this comment

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

Please add the comment that this is needed for map.

std::string abridged() const { return toHex(ref().cropped(0, 4)) + "\342\200\246"; }

/// @returns a version of the hash as a user-readable hex string that leaves out the middle part.
std::string abridgedMiddle() const { return toHex(ref().cropped(0, 4)) + "\342\200\246" + toHex(ref().cropped(N - 4)); }
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the point of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is used in the AST printer to shorten a hash.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can consider replacing that without a shorted version in a different PR then.

@chriseth chriseth merged commit 6475bd9 into develop Aug 25, 2017
@axic axic deleted the cleanupFixedHash branch August 25, 2017 19:31
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.

2 participants

Comments