aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkTDict.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-28 19:03:13 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-28 19:03:13 +0000
commitaa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3 (patch)
treea923a0909df97afcded29ad86c93f72b182d5527 /include/core/SkTDict.h
parent00b1c3ad30c2cfc73a2b83d18a851d872b533cbc (diff)
Make SkTDArray accessors const-friendly.
This change creates const and non-const versions of SkTDArray::begin(), end(), operator[]() and getAt(). This will keep us from inadvertently changing a const SkTDArray, which the previous signatures allowed. Review URL: https://chromiumcodereview.appspot.com/12315131 git-svn-id: http://skia.googlecode.com/svn/trunk@7902 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkTDict.h')
-rw-r--r--include/core/SkTDict.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/core/SkTDict.h b/include/core/SkTDict.h
index b704a48645..49d07d4614 100644
--- a/include/core/SkTDict.h
+++ b/include/core/SkTDict.h
@@ -84,8 +84,8 @@ public:
bool findKey(T& value, const char** name) const
{
- Pair* end = fArray.end();
- for (Pair* pair = fArray.begin(); pair < end; pair++) {
+ const Pair* end = fArray.end();
+ for (const Pair* pair = fArray.begin(); pair < end; pair++) {
if (pair->fValue != value)
continue;
*name = pair->fName;
@@ -131,8 +131,8 @@ public:
return name;
}
private:
- Pair* fIter;
- Pair* fStop;
+ const Pair* fIter;
+ const Pair* fStop;
};
private: