From fc601b54ff15ac7426a80f22dabea678649593bb Mon Sep 17 00:00:00 2001 From: Dario Casalinuovo Date: Mon, 16 Mar 2015 21:03:22 +0100 Subject: [PATCH] TMap/Tlist: set various methods as const. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Duval --- headers/private/media/TList.h | 4 ++-- headers/private/media/TMap.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/headers/private/media/TList.h b/headers/private/media/TList.h index e7c2806d17..52fd782a37 100644 --- a/headers/private/media/TList.h +++ b/headers/private/media/TList.h @@ -54,7 +54,7 @@ public: return true; } - bool Get(int32 index, value **v) + bool Get(int32 index, value **v) const { if (index < 0 || index >= item_count) return false; @@ -74,7 +74,7 @@ public: return true; } - int Find(const value &v) + int Find(const value &v) const { for (int i = 0; i < item_count; i++) if (*items[i] == v) diff --git a/headers/private/media/TMap.h b/headers/private/media/TMap.h index 3a6f2c9f09..85bb262664 100644 --- a/headers/private/media/TMap.h +++ b/headers/private/media/TMap.h @@ -57,7 +57,7 @@ public: return true; } - bool Get(const key &k, value **v) + bool Get(const key &k, value **v) const { for (int i = 0; i < item_count; i++) { if (items[i]->k == k) { @@ -75,7 +75,7 @@ public: return false; } - int Find(const value &v) + int Find(const value &v) const { for (int i = 0; i < item_count; i++) if (items[i]->v == v) @@ -83,7 +83,7 @@ public: return -1; } - bool Has(const key &k) + bool Has(const key &k) const { for (int i = 0; i < item_count; i++) if (items[i]->k == k) @@ -91,12 +91,12 @@ public: return false; } - int CountItems() + int CountItems() const { return item_count; } - bool IsEmpty() + bool IsEmpty() const { return item_count == 0; } @@ -136,7 +136,7 @@ public: } private: - bool _Get(int32 index, value **v) + bool _Get(int32 index, value **v) const { if (index < 0 || index >= item_count) return false;