AVLTreeMap fixes
* AVLTreeMap::_GetKey(): Change return type from const Key& to Key, so the strategy can do that as well and doesn't have have a Key object in the node. * Fix the Auto strategy: It was using the undefined _GetKey() instead of GetKey().
This commit is contained in:
@@ -98,7 +98,7 @@ protected:
|
||||
// strategy shortcuts
|
||||
inline Node* _Allocate(const Key& key, const Value& value);
|
||||
inline void _Free(Node* node);
|
||||
inline const Key& _GetKey(Node* node) const;
|
||||
inline Key _GetKey(Node* node) const;
|
||||
inline Value& _GetValue(Node* node) const;
|
||||
inline AVLTreeNode* _GetAVLTreeNode(const Node* node) const;
|
||||
inline Node* _GetNode(const AVLTreeNode* node) const;
|
||||
@@ -486,7 +486,7 @@ _AVL_TREE_MAP_CLASS_NAME::_Free(Node* node)
|
||||
|
||||
// _GetKey
|
||||
_AVL_TREE_MAP_TEMPLATE_LIST
|
||||
inline const Key&
|
||||
inline Key
|
||||
_AVL_TREE_MAP_CLASS_NAME::_GetKey(Node* node) const
|
||||
{
|
||||
return fStrategy.GetKey(node);
|
||||
@@ -644,12 +644,12 @@ public:
|
||||
|
||||
inline int CompareKeyNode(const Key& a, const Node* b) const
|
||||
{
|
||||
return fCompare(a, _GetKey(b));
|
||||
return fCompare(a, GetKey(b));
|
||||
}
|
||||
|
||||
inline int CompareNodes(const Node* a, const Node* b) const
|
||||
{
|
||||
return fCompare(_GetKey(a), _GetKey(b));
|
||||
return fCompare(GetKey(a), GetKey(b));
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user