Pointless hash function in simple store
Bug #1010051 reported by
Paul J. Lucas
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
Low
|
Markos Zaharioudakis |
Bug Description
The implementation of XmlNode::hash() is:
uint32_t hash(long timezone = 0, const XQPCollator* aCollation = 0) const
{
XmlNode* node = const_cast<
return hashfun:
}
Computing the hash of a pointer is pointless -- just cast the pointer:
uint32_t hash(long timezone = 0, const XQPCollator* aCollation = 0) const
{
return reinterpret_
}
Indeed, the std::hash() function in C++11 for T* does exactly this.
Changed in zorba: | |
assignee: | Matthias Brantner (matthias-brantner) → Markos Zaharioudakis (markos-za) |
Changed in zorba: | |
status: | New → Fix Committed |
Changed in zorba: | |
milestone: | none → 2.6 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
The implementation should also be move out-of-line, i.e., into the .cpp file since it's a virtual function.