Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: src/core/SkTHash.h

Issue 1046293002: SkPDF: SkPDFGraphicState Lookup hashtabled (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-04-01 (Wednesday) 16:16:21 EDT Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/pdf/SkPDFCanon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTHash.h
diff --git a/src/core/SkTHash.h b/src/core/SkTHash.h
index c4bd3b6161c2dbbbb6beeae1da12f1f869813448..3637c53c4662d2863877c3e1261d9362cff176cc 100644
--- a/src/core/SkTHash.h
+++ b/src/core/SkTHash.h
@@ -237,6 +237,12 @@ public:
// This pointer remains valid until the next call to add().
const T* find(const T& item) const { return fTable.find(item); }
+ // Call fn on every item in the set. You may not mutate anything.
+ template <typename Fn> // f(T), f(const T&)
+ void foreach (Fn&& fn) const {
+ fTable.foreach (fn);
+ }
+
private:
struct Traits {
static const T& GetKey(const T& item) { return item; }
« no previous file with comments | « no previous file | src/pdf/SkPDFCanon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698