From d2ed1e776f02672a05debfc80da45ea1af908ab8 Mon Sep 17 00:00:00 2001
From: Dario Casalinuovo <b.vitruvio@gmail.com>
Date: Mon, 16 Mar 2015 21:03:22 +0100
Subject: [PATCH 2/3] TMap/Tlist: set various methods as const.
---
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 e7c2806..52fd782 100644
a
|
b
|
public:
|
54 | 54 | return true; |
55 | 55 | } |
56 | 56 | |
57 | | bool Get(int32 index, value **v) |
| 57 | bool Get(int32 index, value **v) const |
58 | 58 | { |
59 | 59 | if (index < 0 || index >= item_count) |
60 | 60 | return false; |
… |
… |
public:
|
74 | 74 | return true; |
75 | 75 | } |
76 | 76 | |
77 | | int Find(const value &v) |
| 77 | int Find(const value &v) const |
78 | 78 | { |
79 | 79 | for (int i = 0; i < item_count; i++) |
80 | 80 | if (*items[i] == v) |
diff --git a/headers/private/media/TMap.h b/headers/private/media/TMap.h
index 3a6f2c9..85bb262 100644
a
|
b
|
public:
|
57 | 57 | return true; |
58 | 58 | } |
59 | 59 | |
60 | | bool Get(const key &k, value **v) |
| 60 | bool Get(const key &k, value **v) const |
61 | 61 | { |
62 | 62 | for (int i = 0; i < item_count; i++) { |
63 | 63 | if (items[i]->k == k) { |
… |
… |
public:
|
75 | 75 | return false; |
76 | 76 | } |
77 | 77 | |
78 | | int Find(const value &v) |
| 78 | int Find(const value &v) const |
79 | 79 | { |
80 | 80 | for (int i = 0; i < item_count; i++) |
81 | 81 | if (items[i]->v == v) |
… |
… |
public:
|
83 | 83 | return -1; |
84 | 84 | } |
85 | 85 | |
86 | | bool Has(const key &k) |
| 86 | bool Has(const key &k) const |
87 | 87 | { |
88 | 88 | for (int i = 0; i < item_count; i++) |
89 | 89 | if (items[i]->k == k) |
… |
… |
public:
|
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | |
94 | | int CountItems() |
| 94 | int CountItems() const |
95 | 95 | { |
96 | 96 | return item_count; |
97 | 97 | } |
98 | 98 | |
99 | | bool IsEmpty() |
| 99 | bool IsEmpty() const |
100 | 100 | { |
101 | 101 | return item_count == 0; |
102 | 102 | } |
… |
… |
public:
|
136 | 136 | } |
137 | 137 | |
138 | 138 | private: |
139 | | bool _Get(int32 index, value **v) |
| 139 | bool _Get(int32 index, value **v) const |
140 | 140 | { |
141 | 141 | if (index < 0 || index >= item_count) |
142 | 142 | return false; |