From f9dff2cfdceb11ec1797a734c4612a5a0a50176e Mon Sep 17 00:00:00 2001 From: asfernandes Date: Sun, 25 Jan 2015 20:27:18 +0000 Subject: [PATCH] Make methods const. --- src/common/classes/GenericMap.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/classes/GenericMap.h b/src/common/classes/GenericMap.h index 7c6fe107b7..1790a0b563 100644 --- a/src/common/classes/GenericMap.h +++ b/src/common/classes/GenericMap.h @@ -217,9 +217,9 @@ public: } // Returns true if value is found - bool get(const KeyType& key, ValueType& value) + bool get(const KeyType& key, ValueType& value) const { - TreeAccessor treeAccessor(&tree); + ConstTreeAccessor treeAccessor(&tree); if (treeAccessor.locate(key)) { @@ -231,9 +231,9 @@ public: } // Returns pointer to the found value or null otherwise - ValueType* get(const KeyType& key) + ValueType* get(const KeyType& key) const { - TreeAccessor treeAccessor(&tree); + ConstTreeAccessor treeAccessor(&tree); if (treeAccessor.locate(key)) { return &treeAccessor.current()->second; @@ -242,9 +242,9 @@ public: return NULL; } - bool exist(const KeyType& key) + bool exist(const KeyType& key) const { - return TreeAccessor(&tree).locate(key); + return ConstTreeAccessor(&tree).locate(key); } size_t count() const { return mCount; }