Index: src/core/SkTMultiMap.h |
diff --git a/src/core/SkTMultiMap.h b/src/core/SkTMultiMap.h |
index 70076f0cad2d0dc1b2cd0ab7f5df28116916a16b..1168ed6e915a0cd7d0c05144eaa1f1c24516c336 100644 |
--- a/src/core/SkTMultiMap.h |
+++ b/src/core/SkTMultiMap.h |
@@ -102,6 +102,19 @@ public: |
int count() const { return fCount; } |
+#ifdef SK_DEBUG |
+ // This is not particularly fast and only used for validation, so debug only. |
+ int countForKey(const Key& key) const { |
+ int count = 0; |
+ ValueList* list = fHash.find(key); |
+ while (list) { |
+ list = list->fNext; |
+ ++count; |
+ } |
+ return count; |
+ } |
+#endif |
+ |
private: |
SkTDynamicHash<ValueList, Key> fHash; |
int fCount; |