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

Fix for GTEntry_t hash function #14583

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions CondCore/CondDB/interface/Types.h
Expand Up @@ -136,10 +136,12 @@ namespace cond {
return std::get<2>(m_data);
}
std::size_t hashvalue()const{
// taken from TagMetadata existing implementation.
// Is it correct ordering by tag? Tags are not unique in a GT, while record+label are...
// Derived from CondDB v1 TagMetadata implementation.
// Unique Keys constructed with Record and Labels - allowing for multiple references of the same Tag in a GT
boost::hash<std::string> hasher;
std::size_t result=hasher(tagName());
std::string key = recordName();
if( !recordLabel().empty() ) key = key +"_"+recordLabel();
std::size_t result=hasher(key);
return result;
}
bool operator<(const GTEntry_t& toCompare ) const {
Expand Down