Chromium Code Reviews| 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 |
| +} |