OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 package memory | |
6 | |
7 type stringSet map[string]struct{} | |
8 | |
9 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
| |
10 s[value] = struct{}{} | |
11 } | |
12 | |
13 func (s stringSet) Dup() stringSet { | |
14 ret := make(stringSet, len(s)) | |
15 for v := range s { | |
16 ret.Add(v) | |
17 } | |
18 return ret | |
19 } | |
OLD | NEW |