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

Unified Diff: impl/memory/stringset.go

Issue 1302813003: impl/memory: Implement Queries (Closed) Base URL: https://github.com/luci/gae.git@add_multi_iterator
Patch Set: remove limit double-set restriction Created 5 years, 4 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
Index: impl/memory/stringset.go
diff --git a/impl/memory/stringset.go b/impl/memory/stringset.go
new file mode 100644
index 0000000000000000000000000000000000000000..970d8a9c1c55e733e331fa58228c66699ea64da2
--- /dev/null
+++ b/impl/memory/stringset.go
@@ -0,0 +1,19 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package memory
+
+type stringSet map[string]struct{}
+
+func (s stringSet) Add(value string) {
dnj 2015/08/28 20:15:04 nit: Methods should not be exported, since stringS
iannucci 2015/08/28 20:38:50 done. though I usually prefer to export them like
+ s[value] = struct{}{}
+}
+
+func (s stringSet) Dup() stringSet {
+ ret := make(stringSet, len(s))
+ for v := range s {
+ ret.Add(v)
+ }
+ return ret
+}

Powered by Google App Engine
This is Rietveld 408576698