Chromium Code Reviews| Index: src/core/SkTDynamicHash.h |
| diff --git a/src/core/SkTDynamicHash.h b/src/core/SkTDynamicHash.h |
| index 496dc8d1417e6872d29706f277928eb048a1c9fc..b578bfc647d34c45c3405ce9aa42af8d11187c15 100644 |
| --- a/src/core/SkTDynamicHash.h |
| +++ b/src/core/SkTDynamicHash.h |
| @@ -135,6 +135,28 @@ public: |
| fArray = NULL; |
| } |
| + void deleteAll() { |
|
mtklein
2014/07/22 13:54:30
I think you can do both of these just as easily fr
jvanverth1
2014/07/22 14:14:07
Yup, just had that discussion here. Done.
|
| + int index = 0; |
| + while (index < fCapacity) { |
| + if (fArray[index] != Empty() && fArray[index] != Deleted()) { |
| + SkDELETE(fArray[index]); |
| + } |
| + ++index; |
| + } |
| + this->reset(); |
| + } |
| + |
| + void freeAll() { |
| + int index = 0; |
| + while (index < fCapacity) { |
| + if (fArray[index] != Empty() && fArray[index] != Deleted()) { |
| + sk_free(fArray[index]); |
| + } |
| + ++index; |
| + } |
| + this->reset(); |
| + } |
| + |
| protected: |
| // These methods are used by tests only. |